Merge pull request #402 from PR0M3TH3AN/codex/update-test-dictionaries-and-add-new-tests

Add tests for tag-based search
This commit is contained in:
thePR0M3TH3AN
2025-07-08 14:27:35 -04:00
committed by GitHub

View File

@@ -105,3 +105,26 @@ def test_search_no_results():
entry_mgr.add_entry("Example.com", 12, "alice")
result = entry_mgr.search_entries("missing")
assert result == []
def test_search_by_tag_password():
with TemporaryDirectory() as tmpdir:
tmp_path = Path(tmpdir)
entry_mgr = setup_entry_manager(tmp_path)
idx = entry_mgr.add_entry("TaggedSite", 8, tags=["work"])
result = entry_mgr.search_entries("work")
assert result == [(idx, "TaggedSite", "", "", False)]
def test_search_by_tag_totp():
with TemporaryDirectory() as tmpdir:
tmp_path = Path(tmpdir)
entry_mgr = setup_entry_manager(tmp_path)
entry_mgr.add_totp("OTPAccount", TEST_SEED, tags=["mfa"])
idx = entry_mgr.search_entries("OTPAccount")[0][0]
result = entry_mgr.search_entries("mfa")
assert result == [(idx, "OTPAccount", None, None, False)]