mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-19 12:39:14 +00:00
Refactor EntryManager to use BackupManager
This commit is contained in:
@@ -8,6 +8,7 @@ from helpers import create_vault, TEST_SEED, TEST_PASSWORD
|
||||
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from password_manager.entry_management import EntryManager
|
||||
from password_manager.backup import BackupManager
|
||||
from password_manager.vault import Vault
|
||||
from nostr.client import NostrClient
|
||||
|
||||
@@ -16,7 +17,8 @@ def test_backup_and_publish_to_nostr():
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
tmp_path = Path(tmpdir)
|
||||
vault, enc_mgr = create_vault(tmp_path, TEST_SEED, TEST_PASSWORD)
|
||||
entry_mgr = EntryManager(vault, tmp_path)
|
||||
backup_mgr = BackupManager(tmp_path)
|
||||
entry_mgr = EntryManager(vault, backup_mgr)
|
||||
|
||||
# create an index by adding an entry
|
||||
entry_mgr.add_entry("example.com", 12)
|
||||
@@ -34,7 +36,7 @@ def test_backup_and_publish_to_nostr():
|
||||
enc_mgr, "decrypt_parent_seed", return_value="seed"
|
||||
):
|
||||
nostr_client = NostrClient(enc_mgr, "fp")
|
||||
entry_mgr.backup_index_file()
|
||||
entry_mgr.backup_manager.create_backup()
|
||||
result = asyncio.run(nostr_client.publish_snapshot(encrypted_index))
|
||||
|
||||
mock_publish.assert_awaited_with(encrypted_index)
|
||||
|
Reference in New Issue
Block a user