MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / test_non_unix_socket_endpoints

Function test_non_unix_socket_endpoints

sdk/python/tests/test_client.py:261–278  ·  view source on GitHub ↗

Test that client doesn't throw error for non-unix socket paths.

()

Source from the content-addressed store, hash-verified

259
260
261def test_non_unix_socket_endpoints():
262 """Test that client doesn't throw error for non-unix socket paths."""
263 import os
264
265 saved_env = os.environ.get("DSTACK_SIMULATOR_ENDPOINT")
266 if "DSTACK_SIMULATOR_ENDPOINT" in os.environ:
267 del os.environ["DSTACK_SIMULATOR_ENDPOINT"]
268
269 try:
270 # These should not raise errors
271 client1 = DstackClient("http://localhost:8080")
272 client2 = DstackClient("https://example.com")
273 assert client1 is not None
274 assert client2 is not None
275 finally:
276 # Restore environment variable
277 if saved_env:
278 os.environ["DSTACK_SIMULATOR_ENDPOINT"] = saved_env
279
280
281@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

DstackClientClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected