Fix ruff and ESLint warnings in tests and tsconfig

- Wrap long dict literal in test_geo_service.py across multiple lines (E501)
- Combine nested with statements in test_jail_service.py (SIM117)
- Add vitest.config.ts to tsconfig.node.json include so ESLint
  parserOptions.project resolves it correctly
This commit is contained in:
2026-03-11 18:35:30 +01:00
parent 576ec43854
commit 0a73c49d01
3 changed files with 16 additions and 7 deletions

View File

@@ -434,7 +434,14 @@ class TestLookupBatchSingleCommit:
"""When db=None, no commit is attempted."""
ips = ["1.1.1.1"]
batch_response = [
{"query": "1.1.1.1", "status": "success", "countryCode": "US", "country": "United States", "as": "AS15169", "org": "Google LLC"},
{
"query": "1.1.1.1",
"status": "success",
"countryCode": "US",
"country": "United States",
"as": "AS15169",
"org": "Google LLC",
},
]
session = _make_batch_session(batch_response)

View File

@@ -583,9 +583,11 @@ class TestUnbanAllIps:
async def test_unban_all_ips_raises_on_connection_error(self) -> None:
"""unban_all_ips propagates Fail2BanConnectionError."""
with patch(
"app.services.jail_service.Fail2BanClient",
side_effect=Fail2BanConnectionError("unreachable", _SOCKET),
with (
patch(
"app.services.jail_service.Fail2BanClient",
side_effect=Fail2BanConnectionError("unreachable", _SOCKET),
),
pytest.raises(Fail2BanConnectionError),
):
with pytest.raises(Fail2BanConnectionError):
await jail_service.unban_all_ips(_SOCKET)
await jail_service.unban_all_ips(_SOCKET)