Add managed account tests

This commit is contained in:
thePR0M3TH3AN
2025-07-07 21:50:51 -04:00
parent 074b851909
commit 6aef655841
3 changed files with 95 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ def test_handle_list_entries(monkeypatch, capsys):
entry_mgr.add_totp("Example", TEST_SEED)
entry_mgr.add_entry("example.com", 12)
entry_mgr.add_key_value("API", "abc123")
entry_mgr.add_managed_account("acct", TEST_SEED)
inputs = iter(["1", ""]) # list all, then exit
monkeypatch.setattr("builtins.input", lambda *_: next(inputs))
@@ -43,6 +44,7 @@ def test_handle_list_entries(monkeypatch, capsys):
assert "Example" in out
assert "example.com" in out
assert "API" in out
assert "acct" in out
def test_list_entries_show_details(monkeypatch, capsys):
@@ -66,6 +68,7 @@ def test_list_entries_show_details(monkeypatch, capsys):
entry_mgr.add_totp("Example", TEST_SEED)
entry_mgr.add_key_value("API", "val")
entry_mgr.add_managed_account("acct", TEST_SEED)
monkeypatch.setattr(pm.entry_manager, "get_totp_code", lambda *a, **k: "123456")
monkeypatch.setattr(
@@ -85,3 +88,4 @@ def test_list_entries_show_details(monkeypatch, capsys):
assert "Retrieved 2FA Code" in out
assert "123456" in out
assert "API" in out
assert "acct" in out