1
0
Fork 0

chore: minor cleanup, healthcheck

This commit is contained in:
Arthur K. 2026-03-02 20:44:34 +03:00
parent 2611d1bb6d
commit 42282ce8cb
Signed by: wzray
GPG key ID: B97F30FDC4636357
7 changed files with 42 additions and 8 deletions

View file

@ -34,8 +34,8 @@ class FakeProvider(Provider):
def prepare_threshold(self) -> int:
return self._prepare_threshold
def should_prepare_standby(self, usage_percent: int) -> bool:
return usage_percent >= self.prepare_threshold
def should_prepare_standby(self) -> bool:
return False
@property
def name(self) -> str:
@ -113,6 +113,12 @@ def test_token_handler_unknown_provider(monkeypatch):
assert resp.status == 404
def test_health_handler_ok():
resp = asyncio.run(server.health_handler(object()))
assert resp.status == 200
assert resp.text == "ok"
def test_token_handler_success(monkeypatch):
provider = FakeProvider()
monkeypatch.setattr(server, "PROVIDERS", {"fake": provider})