From bfae04723bd3155801f079ab5238018ec8a0cb09 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Fri, 1 May 2026 14:34:04 +0200 Subject: Redesign API by introducing otp2289.OTPResponse type --- tests/test_server.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/test_server.py') diff --git a/tests/test_server.py b/tests/test_server.py index 3099cf7..41a6aea 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -75,6 +75,8 @@ def test_state_validation_md5() -> None: assert state.validated is False assert state.response_validates('0x9e876134d90499dd') is True assert state.response_validates('INCH SEA ANNE LONG AHEM TOUR') is True + response = otp2289.OTPResponse(bytes.fromhex('9e876134d90499dd')) + assert state.response_validates(response) is True assert state.ot_hex == '7965e05436f5029f' assert state.validated is True @@ -87,6 +89,8 @@ def test_state_validation_sha1() -> None: assert state.validated is False assert state.response_validates('0xbb9e6ae1979d8ff4') is True assert state.response_validates('MILT VARY MAST OK SEES WENT') is True + response = otp2289.OTPResponse(bytes.fromhex('bb9e6ae1979d8ff4')) + assert state.response_validates(response) is True assert state.ot_hex == '63d936639734385b' assert state.validated is True -- cgit v1.3