The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(backup): assert the integrity-failure message on corrupt import
kshitijk4poor513b1bc469d8
diff --git a/tests/hermes_cli/test_restore_source_integrity.py b/tests/hermes_cli/test_restore_source_integrity.pyindex 55062959bac..b25c23e5683 100644--- a/tests/hermes_cli/test_restore_source_integrity.py+++ b/tests/hermes_cli/test_restore_source_integrity.py@@ -83,7 +83,9 @@ def test_restore_uses_literal_paths_and_preserves_live_connection(@pytest.mark.parametrize("entry", ["snapshot", "import"])@pytest.mark.parametrize("damage", ["header", "btree", "truncated"])-def test_corrupt_source_cannot_replace_a_healthy_database(tmp_path, home, entry, damage):+def test_corrupt_source_cannot_replace_a_healthy_database(+ tmp_path, capsys, home, entry, damage+):live = home / "state.db"with closing(sqlite3.connect(live)) as db:db.execute("CREATE TABLE evidence(value TEXT)")@@ -113,6 +115,9 @@ def test_corrupt_source_cannot_replace_a_healthy_database(tmp_path, home, entry,inode = live.stat().st_inoassert not _restore(entry, home, snapshot_id, source)+ if entry == "import":+ captured = capsys.readouterr()+ assert "failed its integrity check" in captured.out + captured.errassert live.read_bytes() == beforeassert live.stat().st_ino == inode