Test that client doesn't throw error for non-unix socket paths.
()
| 259 | |
| 260 | |
| 261 | def 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 |
nothing calls this directly
no test coverage detected