Initial commit: MISF VOB download and upload automation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
c2dec96b1f
43 files changed
+10944
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"""Unit tests for TOTP secret sanitization."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
SRC = Path(__file__).resolve().parent.parent / "src"
|
||||
sys.path.insert(0, str(SRC))
|
||||
|
||||
from totp_utils import sanitize_totp_secret, validate_totp_secret # noqa: E402
|
||||
|
||||
|
||||
def test_sanitize_strips_separators() -> None:
|
||||
assert sanitize_totp_secret("jbsw y3dp-ehpk3pxp") == "JBSWY3DPEHPK3PXP"
|
||||
|
||||
|
||||
def test_sanitize_maps_zero_one() -> None:
|
||||
assert sanitize_totp_secret("JBSW03DP") == "JBSWO3DP"
|
||||
|
||||
|
||||
def test_validate_rejects_invalid_chars() -> None:
|
||||
with pytest.raises(ValueError, match="not valid Base32"):
|
||||
validate_totp_secret("not-valid-secret!")
|
||||
|
||||
|
||||
def test_validate_accepts_standard_secret() -> None:
|
||||
assert validate_totp_secret("JBSWY3DPEHPK3PXP") == "JBSWY3DPEHPK3PXP"
|
||||
Reference in new issue
Block a user