Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
parent
3075c63e01
commit
82cfe3da5a
10 changed files with 660 additions and 4 deletions
|
|
@ -27,3 +27,26 @@ def test_purge_confirmed_deletes(tmp_path, monkeypatch, capsys):
|
|||
assert main(["purge", "--yes"]) == 0
|
||||
assert "Purged" in capsys.readouterr().out
|
||||
assert len(Store(state / "tamq.sqlite3").list()) == 0
|
||||
|
||||
|
||||
def test_feedback_chain_purge_selects_only_reflected_direction(
|
||||
tmp_path, monkeypatch, capsys
|
||||
):
|
||||
state = tmp_path / "state"
|
||||
monkeypatch.setenv("TAMQ_STATE_DIR", str(state))
|
||||
store = Store(state / "tamq.sqlite3")
|
||||
root = store.add("a", "b", "body")
|
||||
child = store.add("b", "a", f"body [{root}]")
|
||||
grandchild = store.add("a", "b", f"body [{root}] [{child}]")
|
||||
unrelated = store.add("a", "b", f"not reflected [{root}]")
|
||||
store.close()
|
||||
|
||||
args = ["purge", "--feedback-chain", root]
|
||||
assert main(args) == 0
|
||||
assert "Dry run: 3 message(s)" in capsys.readouterr().out
|
||||
assert len(Store(state / "tamq.sqlite3").list()) == 4
|
||||
|
||||
assert main([*args, "--yes"]) == 0
|
||||
assert "Purged 3" in capsys.readouterr().out
|
||||
remaining = Store(state / "tamq.sqlite3").list()
|
||||
assert [row["message_id"] for row in remaining] == [unrelated]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue