Return all Nostr event IDs

This commit is contained in:
thePR0M3TH3AN
2025-07-17 15:21:08 -04:00
parent f3c223a9a1
commit c787651899
6 changed files with 54 additions and 19 deletions

View File

@@ -53,7 +53,11 @@ class DummyPM:
self.nostr_client = SimpleNamespace(
key_manager=SimpleNamespace(get_npub=lambda: "npub")
)
self.sync_vault = lambda: "event"
self.sync_vault = lambda: {
"manifest_id": "event",
"chunk_ids": ["c1"],
"delta_ids": [],
}
self.config_manager = SimpleNamespace(
load_config=lambda require_pin=False: {"inactivity_timeout": 30},
set_inactivity_timeout=lambda v: None,

View File

@@ -9,12 +9,17 @@ import main
def test_handle_post_success(capsys):
pm = SimpleNamespace(
sync_vault=lambda alt_summary=None: "abcd",
sync_vault=lambda alt_summary=None: {
"manifest_id": "abcd",
"chunk_ids": ["c1", "c2"],
"delta_ids": ["d1"],
},
)
main.handle_post_to_nostr(pm)
out = capsys.readouterr().out
assert "✅ Sync complete." in out
assert "abcd" in out
assert "c1" in out and "c2" in out and "d1" in out
def test_handle_post_failure(capsys):

View File

@@ -288,7 +288,11 @@ def test_nostr_sync(monkeypatch):
def sync_vault():
called["called"] = True
return "evt123"
return {
"manifest_id": "evt123",
"chunk_ids": ["c1"],
"delta_ids": ["d1"],
}
pm = SimpleNamespace(sync_vault=sync_vault, select_fingerprint=lambda fp: None)
monkeypatch.setattr(cli, "PasswordManager", lambda: pm)
@@ -296,6 +300,8 @@ def test_nostr_sync(monkeypatch):
assert result.exit_code == 0
assert called.get("called") is True
assert "evt123" in result.stdout
assert "c1" in result.stdout
assert "d1" in result.stdout
def test_generate_password(monkeypatch):