feat: metadata store (CN→email) and .ovpn config builder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
tests/test_metadata.py
Normal file
16
tests/test_metadata.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from openvpncertupdate import load_metadata, save_email, get_email
|
||||
|
||||
def test_load_empty(tmp_path):
|
||||
assert load_metadata(str(tmp_path)) == {}
|
||||
|
||||
def test_save_and_get(tmp_path):
|
||||
save_email(str(tmp_path), "alice", "alice@example.com")
|
||||
assert get_email(str(tmp_path), "alice") == "alice@example.com"
|
||||
|
||||
def test_update_existing(tmp_path):
|
||||
save_email(str(tmp_path), "alice", "old@example.com")
|
||||
save_email(str(tmp_path), "alice", "new@example.com")
|
||||
assert get_email(str(tmp_path), "alice") == "new@example.com"
|
||||
|
||||
def test_missing_returns_empty(tmp_path):
|
||||
assert get_email(str(tmp_path), "nobody") == ""
|
||||
Reference in New Issue
Block a user