feat: add tags support to entries

This commit is contained in:
thePR0M3TH3AN
2025-07-08 13:59:05 -04:00
parent 91bc241bbd
commit 66794946c7
10 changed files with 143 additions and 6 deletions

View File

@@ -39,6 +39,7 @@ def test_add_and_retrieve_entry():
"kind": "password",
"notes": "",
"custom_fields": custom,
"tags": [],
}
data = enc_mgr.load_json_data(entry_mgr.index_file)

View File

@@ -33,6 +33,7 @@ def test_add_and_modify_key_value():
"notes": "token",
"archived": False,
"custom_fields": [],
"tags": [],
}
em.modify_entry(idx, value="def456")

View File

@@ -48,6 +48,7 @@ def test_handle_add_totp(monkeypatch, capsys):
"", # period
"", # digits
"", # notes
"", # tags
]
)
monkeypatch.setattr("builtins.input", lambda *args, **kwargs: next(inputs))
@@ -66,5 +67,6 @@ def test_handle_add_totp(monkeypatch, capsys):
"digits": 6,
"archived": False,
"notes": "",
"tags": [],
}
assert "ID 0" in out

View File

@@ -54,6 +54,7 @@ def test_manager_workflow(monkeypatch):
"", # username
"", # url
"", # notes
"", # tags
"n", # add custom field
"", # length (default)
"0", # retrieve index
@@ -65,6 +66,7 @@ def test_manager_workflow(monkeypatch):
"", # archive status
"", # new notes
"n", # edit custom fields
"", # tags keep
]
)
monkeypatch.setattr("builtins.input", lambda *args, **kwargs: next(inputs))

View File

@@ -31,6 +31,7 @@ def test_nostr_key_determinism():
"label": "main",
"notes": "",
"archived": False,
"tags": [],
}
npub1, nsec1 = entry_mgr.get_nostr_key_pair(idx, TEST_SEED)

View File

@@ -42,6 +42,7 @@ def test_seed_phrase_determinism():
"word_count": 12,
"notes": "",
"archived": False,
"tags": [],
}
assert entry24 == {
@@ -52,6 +53,7 @@ def test_seed_phrase_determinism():
"word_count": 24,
"notes": "",
"archived": False,
"tags": [],
}
assert phrase12_a not in entry12.values()

View File

@@ -29,6 +29,7 @@ def test_add_and_retrieve_ssh_key_pair():
"label": "ssh",
"notes": "",
"archived": False,
"tags": [],
}
priv1, pub1 = entry_mgr.get_ssh_key_pair(index, TEST_SEED)

View File

@@ -37,6 +37,7 @@ def test_add_totp_and_get_code():
"digits": 6,
"archived": False,
"notes": "",
"tags": [],
}
code = entry_mgr.get_totp_code(0, TEST_SEED, timestamp=0)
@@ -76,6 +77,7 @@ def test_add_totp_imported(tmp_path):
"digits": 6,
"archived": False,
"notes": "",
"tags": [],
}
code = em.get_totp_code(0, timestamp=0)
assert code == pyotp.TOTP(secret).at(0)