|
23 | 23 | _PYTHON_CLOUDPICKLE_BOOTSTRAP, |
24 | 24 | _SANDBOX_PYTHON_BIN, |
25 | 25 | ClientCredentialsAuth, |
26 | | - InferenceRouteClient, |
27 | 26 | Sandbox, |
28 | 27 | SandboxClient, |
29 | 28 | SandboxError, |
@@ -403,34 +402,6 @@ def ExecSandbox( |
403 | 402 | ) |
404 | 403 |
|
405 | 404 |
|
406 | | -class _FakeInferenceStub: |
407 | | - def __init__(self) -> None: |
408 | | - self.set_request = None |
409 | | - self.get_request = None |
410 | | - |
411 | | - def SetInferenceRoute(self, request: Any, timeout: float | None = None) -> Any: |
412 | | - self.set_request = request |
413 | | - _ = timeout |
414 | | - |
415 | | - class _Response: |
416 | | - provider_name = request.provider_name |
417 | | - model_id = request.model_id |
418 | | - version = 1 |
419 | | - |
420 | | - return _Response() |
421 | | - |
422 | | - def GetInferenceRoute(self, request: Any, timeout: float | None = None) -> Any: |
423 | | - self.get_request = request |
424 | | - _ = timeout |
425 | | - |
426 | | - class _Response: |
427 | | - provider_name = "openai-dev" |
428 | | - model_id = "gpt-4.1" |
429 | | - version = 2 |
430 | | - |
431 | | - return _Response() |
432 | | - |
433 | | - |
434 | 405 | def _client_with_fake_stub(stub: object) -> SandboxClient: |
435 | 406 | client = cast("SandboxClient", object.__new__(SandboxClient)) |
436 | 407 | client._timeout = 30.0 |
@@ -1877,39 +1848,6 @@ def fake_from_active_cluster(**kwargs: Any) -> Any: |
1877 | 1848 | assert captured["insecure"] is False |
1878 | 1849 |
|
1879 | 1850 |
|
1880 | | -def test_inference_set_route_forwards_workspace_and_no_verify() -> None: |
1881 | | - stub = _FakeInferenceStub() |
1882 | | - client = cast("InferenceRouteClient", object.__new__(InferenceRouteClient)) |
1883 | | - client._timeout = 30.0 |
1884 | | - client._stub = cast("Any", stub) |
1885 | | - |
1886 | | - client.set_route( |
1887 | | - workspace="production", |
1888 | | - provider_name="openai-dev", |
1889 | | - model_id="gpt-4.1", |
1890 | | - no_verify=True, |
1891 | | - ) |
1892 | | - |
1893 | | - assert stub.set_request is not None |
1894 | | - assert stub.set_request.no_verify is True |
1895 | | - assert stub.set_request.workspace == "production" |
1896 | | - |
1897 | | - |
1898 | | -def test_inference_get_route_forwards_workspace() -> None: |
1899 | | - stub = _FakeInferenceStub() |
1900 | | - client = cast("InferenceRouteClient", object.__new__(InferenceRouteClient)) |
1901 | | - client._timeout = 30.0 |
1902 | | - client._stub = cast("Any", stub) |
1903 | | - |
1904 | | - config = client.get_route(workspace="staging") |
1905 | | - |
1906 | | - assert stub.get_request is not None |
1907 | | - assert stub.get_request.workspace == "staging" |
1908 | | - assert config.provider_name == "openai-dev" |
1909 | | - assert config.model_id == "gpt-4.1" |
1910 | | - assert config.version == 2 |
1911 | | - |
1912 | | - |
1913 | 1851 | # --------------------------------------------------------------------------- |
1914 | 1852 | # Encoding regression tests (utf-8 explicit on all config file reads/writes) |
1915 | 1853 | # --------------------------------------------------------------------------- |
|
0 commit comments