test: format test suite

This commit is contained in:
huanghuoguoguo
2026-06-16 11:13:05 +08:00
parent 1ae5aacc00
commit ff0c5a6f0a
92 changed files with 1658 additions and 1713 deletions

View File

@@ -60,10 +60,12 @@ class TestProxyManager:
async def test_initialize_config_overrides_env(self):
"""Config proxy overrides environment variables."""
mock_app = self._create_mock_app(proxy_config={
'http': 'http://config-proxy:8080',
'https': 'https://config-proxy:8443',
})
mock_app = self._create_mock_app(
proxy_config={
'http': 'http://config-proxy:8080',
'https': 'https://config-proxy:8443',
}
)
with patch.dict(os.environ, {'HTTP_PROXY': 'http://env-proxy:8080'}):
pm = ProxyManager(mock_app)
@@ -74,10 +76,12 @@ class TestProxyManager:
async def test_initialize_sets_env_variables(self):
"""initialize sets proxy to environment variables."""
mock_app = self._create_mock_app(proxy_config={
'http': 'http://test-proxy:8080',
'https': 'https://test-proxy:8443',
})
mock_app = self._create_mock_app(
proxy_config={
'http': 'http://test-proxy:8080',
'https': 'https://test-proxy:8443',
}
)
pm = ProxyManager(mock_app)
await pm.initialize()
@@ -143,9 +147,11 @@ class TestProxyManager:
async def test_initialize_http_only_config(self):
"""initialize handles http-only config."""
mock_app = self._create_mock_app(proxy_config={
'http': 'http://http-only:8080',
})
mock_app = self._create_mock_app(
proxy_config={
'http': 'http://http-only:8080',
}
)
# Clear any existing proxy env vars
env_backup = {}