feat: harden sms activation skill and add deterministic e2e runner
This commit is contained in:
commit
702280a416
22 files changed
+24363
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from protocols._common import extract_code, normalize_status, redact_url_secrets
|
||||
|
||||
|
||||
def test_extract_code():
|
||||
assert extract_code("Your code is 123456") == "123456"
|
||||
assert extract_code("no code") is None
|
||||
|
||||
|
||||
def test_normalize_smsvn():
|
||||
assert normalize_status("smsvn", "STATUS_WAIT_CODE") == "waiting"
|
||||
assert normalize_status("smsvn", "STATUS_OK:8888") == "code_received"
|
||||
|
||||
|
||||
def test_normalize_5sim():
|
||||
assert normalize_status("5sim", "PENDING") == "waiting"
|
||||
assert normalize_status("5sim", "RECEIVED") == "code_received"
|
||||
|
||||
|
||||
def test_redact_url_secrets():
|
||||
u = "https://x.test/stubs/handler_api.php?api_key=SECRET123&action=getBalance&token=ABC"
|
||||
redacted = redact_url_secrets(u)
|
||||
assert "SECRET123" not in redacted
|
||||
assert "ABC" not in redacted
|
||||
assert "api_key=%2A%2A%2A" in redacted
|
||||
assert "token=%2A%2A%2A" in redacted
|
||||
Reference in new issue
Block a user