mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
sync from nostr on unlock
This commit is contained in:
@@ -81,6 +81,7 @@ def test_password_change_and_unlock(monkeypatch):
|
||||
)
|
||||
monkeypatch.setattr(PasswordManager, "initialize_bip85", lambda self: None)
|
||||
monkeypatch.setattr(PasswordManager, "initialize_managers", lambda self: None)
|
||||
monkeypatch.setattr(PasswordManager, "sync_index_from_nostr", lambda self: None)
|
||||
|
||||
pm.unlock_vault()
|
||||
|
||||
|
26
src/tests/test_unlock_sync.py
Normal file
26
src/tests/test_unlock_sync.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import time
|
||||
from types import SimpleNamespace
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from password_manager.manager import PasswordManager
|
||||
|
||||
|
||||
def test_unlock_triggers_sync(monkeypatch, tmp_path):
|
||||
pm = PasswordManager.__new__(PasswordManager)
|
||||
pm.fingerprint_dir = tmp_path
|
||||
pm.setup_encryption_manager = lambda *a, **k: None
|
||||
pm.initialize_bip85 = lambda: None
|
||||
pm.initialize_managers = lambda: None
|
||||
called = {"sync": False}
|
||||
|
||||
def fake_sync(self):
|
||||
called["sync"] = True
|
||||
|
||||
monkeypatch.setattr(PasswordManager, "sync_index_from_nostr", fake_sync)
|
||||
|
||||
pm.unlock_vault()
|
||||
|
||||
assert called["sync"]
|
Reference in New Issue
Block a user