test_harmony_envelope.py
python
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3
docs: docstring sprint contract→find-symbol — idiomatic run…
Sonnet 4.6
patch
138 days ago
| 1 | """Envelope tests for muse harmony subcommands.""" |
| 2 | from __future__ import annotations |
| 3 | import json |
| 4 | import pytest |
| 5 | from tests.cli_test_helper import CliRunner |
| 6 | |
| 7 | runner = CliRunner() |
| 8 | |
| 9 | _FIELDS = ("muse_version", "schema", "timestamp", "warnings") |
| 10 | |
| 11 | |
| 12 | def _check(d: dict) -> None: |
| 13 | for f in _FIELDS: |
| 14 | assert f in d, f"missing {f}" |
| 15 | assert "schema_version" not in d |
| 16 | |
| 17 | |
| 18 | class TestHarmonyEnvelope: |
| 19 | def test_harmony_list_has_envelope(self): |
| 20 | r = runner.invoke(None, ["harmony", "list", "--json"]) |
| 21 | assert r.exit_code == 0, r.output |
| 22 | _check(json.loads(r.output)) |
| 23 | |
| 24 | def test_harmony_policy_list_has_envelope(self): |
| 25 | r = runner.invoke(None, ["harmony", "policy-list", "--json"]) |
| 26 | assert r.exit_code == 0, r.output |
| 27 | _check(json.loads(r.output)) |
| 28 | |
| 29 | def test_harmony_audit_has_envelope(self): |
| 30 | r = runner.invoke(None, ["harmony", "audit", "--json"]) |
| 31 | assert r.exit_code == 0, r.output |
| 32 | _check(json.loads(r.output)) |
| 33 | |
| 34 | def test_harmony_escalations_has_envelope(self): |
| 35 | r = runner.invoke(None, ["harmony", "escalations", "--json"]) |
| 36 | assert r.exit_code == 0, r.output |
| 37 | _check(json.loads(r.output)) |
| 38 | |
| 39 | def test_harmony_gc_has_envelope(self): |
| 40 | r = runner.invoke(None, ["harmony", "gc", "--json"]) |
| 41 | assert r.exit_code == 0, r.output |
| 42 | _check(json.loads(r.output)) |
File History
1 commit
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3
docs: docstring sprint contract→find-symbol — idiomatic run…
Sonnet 4.6
patch
138 days ago