fix(api_server): fall back to default port on malformed API_SERVER_PORT

This commit is contained in:
Zyproth 2026-05-04 00:03:36 +03:00 committed by Teknium
parent 65bebb9b80
commit a5cae16496
2 changed files with 18 additions and 1 deletions

View file

@ -240,6 +240,12 @@ class TestAdapterInit:
"http://127.0.0.1:3000",
)
def test_invalid_port_from_env_falls_back_to_default(self, monkeypatch):
monkeypatch.setenv("API_SERVER_PORT", "not-a-port")
config = PlatformConfig(enabled=True)
adapter = APIServerAdapter(config)
assert adapter._port == 8642
# ---------------------------------------------------------------------------
# Auth checking