Add tests for sync and snapshot functionality

This commit is contained in:
thePR0M3TH3AN
2025-07-17 15:39:05 -04:00
parent e5858cba38
commit 576437223a
3 changed files with 69 additions and 0 deletions

View File

@@ -29,3 +29,24 @@ def test_handle_post_failure(capsys):
main.handle_post_to_nostr(pm)
out = capsys.readouterr().out
assert "❌ Sync failed…" in out
def test_handle_post_prints_all_ids(capsys):
pm = SimpleNamespace(
sync_vault=lambda alt_summary=None: {
"manifest_id": "m1",
"chunk_ids": ["c1", "c2"],
"delta_ids": ["d1", "d2"],
}
)
main.handle_post_to_nostr(pm)
out_lines = capsys.readouterr().out.splitlines()
expected = [
" manifest: m1",
" chunk: c1",
" chunk: c2",
" delta: d1",
" delta: d2",
]
for line in expected:
assert any(line in ol for ol in out_lines)