mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Add archived flag to entries
This commit is contained in:
@@ -34,7 +34,7 @@ def test_add_and_retrieve_entry():
|
||||
"length": 12,
|
||||
"username": "user",
|
||||
"url": "",
|
||||
"blacklisted": False,
|
||||
"archived": False,
|
||||
"type": "password",
|
||||
"kind": "password",
|
||||
"notes": "",
|
||||
|
@@ -63,5 +63,6 @@ def test_handle_add_totp(monkeypatch, capsys):
|
||||
"index": 0,
|
||||
"period": 30,
|
||||
"digits": 6,
|
||||
"archived": False,
|
||||
}
|
||||
assert "ID 0" in out
|
||||
|
@@ -61,7 +61,7 @@ def test_handle_display_totp_codes(monkeypatch, capsys):
|
||||
assert "123456" in out
|
||||
|
||||
|
||||
def test_display_totp_codes_excludes_blacklisted(monkeypatch, capsys):
|
||||
def test_display_totp_codes_excludes_archived(monkeypatch, capsys):
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
tmp_path = Path(tmpdir)
|
||||
vault, enc_mgr = create_vault(tmp_path, TEST_SEED, TEST_PASSWORD)
|
||||
@@ -83,7 +83,7 @@ def test_display_totp_codes_excludes_blacklisted(monkeypatch, capsys):
|
||||
|
||||
entry_mgr.add_totp("Visible", TEST_SEED)
|
||||
entry_mgr.add_totp("Hidden", TEST_SEED)
|
||||
entry_mgr.modify_entry(1, blacklisted=True)
|
||||
entry_mgr.modify_entry(1, archived=True)
|
||||
|
||||
monkeypatch.setattr(pm.entry_manager, "get_totp_code", lambda *a, **k: "123456")
|
||||
monkeypatch.setattr(
|
||||
|
@@ -30,6 +30,7 @@ def test_nostr_key_determinism():
|
||||
"index": idx,
|
||||
"label": "main",
|
||||
"notes": "",
|
||||
"archived": False,
|
||||
}
|
||||
|
||||
npub1, nsec1 = entry_mgr.get_nostr_key_pair(idx, TEST_SEED)
|
||||
|
@@ -28,6 +28,7 @@ def test_add_and_retrieve_ssh_key_pair():
|
||||
"index": index,
|
||||
"label": "ssh",
|
||||
"notes": "",
|
||||
"archived": False,
|
||||
}
|
||||
|
||||
priv1, pub1 = entry_mgr.get_ssh_key_pair(index, TEST_SEED)
|
||||
|
@@ -35,6 +35,7 @@ def test_add_totp_and_get_code():
|
||||
"index": 0,
|
||||
"period": 30,
|
||||
"digits": 6,
|
||||
"archived": False,
|
||||
}
|
||||
|
||||
code = entry_mgr.get_totp_code(0, TEST_SEED, timestamp=0)
|
||||
@@ -72,6 +73,7 @@ def test_add_totp_imported(tmp_path):
|
||||
"secret": secret,
|
||||
"period": 30,
|
||||
"digits": 6,
|
||||
"archived": False,
|
||||
}
|
||||
code = em.get_totp_code(0, timestamp=0)
|
||||
assert code == pyotp.TOTP(secret).at(0)
|
||||
|
Reference in New Issue
Block a user