Implement approval engine production readiness
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a05e2e-805b-7042-a750-71f473bceea2
This commit is contained in:
parent
ebce5abb27
commit
2bd2d19a98
30 changed files with 1679 additions and 53 deletions
|
|
@ -127,13 +127,29 @@ def test_claim_after_revoke(app):
|
|||
|
||||
def test_store_unavailable_is_503():
|
||||
from approval_engine.api import App
|
||||
from approval_engine.auth import Identity, StaticTokenAuthenticator
|
||||
from approval_engine.errors import StoreUnavailable
|
||||
from approval_engine.store import Engine
|
||||
|
||||
class Dead(Engine):
|
||||
def storage_status(self):
|
||||
return {"schema_current": True, "persistent": True}
|
||||
|
||||
def outbox_stats(self):
|
||||
raise StoreUnavailable("down")
|
||||
|
||||
status, body = call(App(Dead.__new__(Dead)), "GET", "/v1/readyz")
|
||||
identity = Identity(
|
||||
subject="test",
|
||||
issuer="test",
|
||||
audiences=("approval-engine",),
|
||||
principal_type="service",
|
||||
tenant="test",
|
||||
roles=frozenset(),
|
||||
scopes=frozenset(),
|
||||
assurance={},
|
||||
evidence_ref="test",
|
||||
)
|
||||
app = App(Dead.__new__(Dead), StaticTokenAuthenticator({"test-token": identity}))
|
||||
status, body = call(app, "GET", "/v1/readyz")
|
||||
assert status == 503
|
||||
assert body["error"] == "store_unavailable"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue