From 1961cebd00c32f8706cc8a8d18ebab8b66bf758c Mon Sep 17 00:00:00 2001 From: Kayzo Date: Tue, 21 Apr 2026 19:38:32 +0000 Subject: [PATCH] chore: format proxy route tests with ruff --- tests/test_proxy_codex_route_aliases.py | 4 +--- ...st_proxy_google_cloudcode_route_aliases.py | 22 +++++++++---------- .../test_proxy_streaming_ratelimit_headers.py | 4 +--- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/tests/test_proxy_codex_route_aliases.py b/tests/test_proxy_codex_route_aliases.py index d74529d2e..780619995 100644 --- a/tests/test_proxy_codex_route_aliases.py +++ b/tests/test_proxy_codex_route_aliases.py @@ -118,9 +118,7 @@ def test_codex_responses_subpath_aliases_delegate_to_passthrough(): ), ], ) -def test_codex_responses_subpath_passthrough_derives_chatgpt_routing_from_jwt( - path, expected_url -): +def test_codex_responses_subpath_passthrough_derives_chatgpt_routing_from_jwt(path, expected_url): class FakeAsyncClient: def __init__(self) -> None: self.calls: list[tuple[str, str, dict[str, str]]] = [] diff --git a/tests/test_proxy_google_cloudcode_route_aliases.py b/tests/test_proxy_google_cloudcode_route_aliases.py index 5f2a85592..b94e918fd 100644 --- a/tests/test_proxy_google_cloudcode_route_aliases.py +++ b/tests/test_proxy_google_cloudcode_route_aliases.py @@ -98,9 +98,7 @@ def test_cloudcode_route_uses_cloudcode_api_override(monkeypatch): monkeypatch.setattr(HeadroomProxy, "_stream_response", fake_stream) with TestClient( - create_app( - ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test/v1") - ) + create_app(ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test/v1")) ) as client: response = client.post( "/v1/v1internal:streamGenerateContent", @@ -150,9 +148,7 @@ def test_antigravity_route_does_not_cross_route_to_cloudcode_override(monkeypatc monkeypatch.setattr(HeadroomProxy, "_stream_response", fake_stream) with TestClient( - create_app( - ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test") - ) + create_app(ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test")) ) as client: response = client.post( "/v1internal:streamGenerateContent", @@ -175,9 +171,7 @@ def test_cloudcode_override_does_not_leak_between_app_instances(monkeypatch): monkeypatch.setattr(HeadroomProxy, "_stream_response", fake_stream) with TestClient( - create_app( - ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test") - ) + create_app(ProxyConfig(optimize=False, cloudcode_api_url="https://cloudcode-proxy.test")) ) as client: first = client.post( "/v1internal:streamGenerateContent", @@ -193,6 +187,12 @@ def test_cloudcode_override_does_not_leak_between_app_instances(monkeypatch): ) assert first.status_code == 200 - assert first.json()["url"] == "https://cloudcode-proxy.test/v1internal:streamGenerateContent?alt=sse" + assert ( + first.json()["url"] + == "https://cloudcode-proxy.test/v1internal:streamGenerateContent?alt=sse" + ) assert second.status_code == 200 - assert second.json()["url"] == "https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse" + assert ( + second.json()["url"] + == "https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse" + ) diff --git a/tests/test_proxy_streaming_ratelimit_headers.py b/tests/test_proxy_streaming_ratelimit_headers.py index d11d41c5c..c6a69857c 100644 --- a/tests/test_proxy_streaming_ratelimit_headers.py +++ b/tests/test_proxy_streaming_ratelimit_headers.py @@ -220,9 +220,7 @@ class TestStreamingRatelimitHeaderForwarding: "content-length": "42", } ) - mock_response.aread = AsyncMock( - return_value=b'{"error":{"message":"capacity exhausted"}}' - ) + mock_response.aread = AsyncMock(return_value=b'{"error":{"message":"capacity exhausted"}}') mock_response.aclose = AsyncMock() mock_request = MagicMock()