Skip to content

Commit 91b3cdf

Browse files
committed
test(todos): cover full CLI status without historic consumers
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
1 parent dedf095 commit 91b3cdf

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎tests/control_plane/test_todo_consumer_retirement.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,22 @@ def test_public_imports_keep_same_owners():
7878
):
7979
for name in names:
8080
assert getattr(historic, name) is getattr(owner, name)
81+
82+
83+
@pytest.mark.parametrize("provider", ["file", "sqlite"])
84+
def test_full_cli_status_loads_without_historic_consumers(tmp_path, provider, consumer_distribution):
85+
from canonical_authority_fixture import promoted_create_fixture
86+
87+
registry, runtime, state = promoted_create_fixture(tmp_path, provider=provider)
88+
before = {str(p.relative_to(tmp_path)): p.read_bytes()
89+
for root in (runtime, state.parent) for p in root.rglob("*") if p.is_file()}
90+
result = subprocess.run(
91+
[*consumer_distribution[1], "--registry", str(registry), "--runtime-root", str(runtime),
92+
"--format", "json", "authority-shadow", "status", "--goal-id", "goal-a"],
93+
cwd=tmp_path, capture_output=True, text=True, timeout=60,
94+
)
95+
assert result.returncode == 0, result.stdout + result.stderr
96+
payload = json.loads(result.stdout)
97+
assert payload["ok"] and payload["candidate"]["status"] == "missing"
98+
assert {str(p.relative_to(tmp_path)): p.read_bytes()
99+
for root in (runtime, state.parent) for p in root.rglob("*") if p.is_file()} == before

0 commit comments

Comments
 (0)