chore: minor cleanup, healthcheck
This commit is contained in:
parent
2611d1bb6d
commit
42282ce8cb
7 changed files with 42 additions and 8 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue