feat(demo): add auth flow UI service
This commit is contained in:
20
tests/test_debug_sms_client.py
Normal file
20
tests/test_debug_sms_client.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from gapido_auth.infrastructure.debug_sms_client import DebugSmsClient, debug_sms_key
|
||||
|
||||
|
||||
class FakeDebugStore:
|
||||
def __init__(self) -> None:
|
||||
self.values: dict[str, tuple[int, str]] = {}
|
||||
|
||||
async def setex(self, name: str, time: int, value: str) -> object:
|
||||
self.values[name] = (time, value)
|
||||
return True
|
||||
|
||||
|
||||
async def test_debug_sms_client_stores_latest_otp() -> None:
|
||||
store = FakeDebugStore()
|
||||
client = DebugSmsClient(store, ttl_seconds=300)
|
||||
|
||||
await client.send_otp("989120000000", "123456", "debug-otp")
|
||||
|
||||
assert store.values[debug_sms_key("989120000000")] == (300, "123456")
|
||||
|
||||
Reference in New Issue
Block a user