mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-17 19:49:12 +00:00
Add tests for sync and snapshot functionality
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user