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
22
tests/test_cli.py
Normal file
22
tests/test_cli.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from approval_engine.cli import main
|
||||
|
||||
|
||||
def test_migrate_verify_and_backup_commands(tmp_path, capsys):
|
||||
database = tmp_path / "approval.sqlite"
|
||||
backup = tmp_path / "approval.backup.sqlite"
|
||||
assert main(["migrate", "--db", str(database)]) == 0
|
||||
migrated = json.loads(capsys.readouterr().out)
|
||||
assert migrated["ok"] is True
|
||||
assert main(["verify", "--db", str(database)]) == 0
|
||||
assert json.loads(capsys.readouterr().out)["schema_current"] is True
|
||||
assert main(["backup", "--db", str(database), "--output", str(backup)]) == 0
|
||||
assert json.loads(capsys.readouterr().out)["integrity"] == "ok"
|
||||
|
||||
|
||||
def test_production_refuses_memory_store_before_serving():
|
||||
with pytest.raises(SystemExit):
|
||||
main(["serve", "--production", "--db", ":memory:"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue