diff options
Diffstat (limited to 'tests/test_static.py')
| -rw-r--r-- | tests/test_static.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/test_static.py b/tests/test_static.py index 589fc17..7268e84 100644 --- a/tests/test_static.py +++ b/tests/test_static.py | |||
| @@ -32,58 +32,58 @@ import otp2289 | |||
| 32 | def test_bytes_and_tokens() -> None: | 32 | def test_bytes_and_tokens() -> None: |
| 33 | """Tests the official hex and tokens defined in RFC2289""" | 33 | """Tests the official hex and tokens defined in RFC2289""" |
| 34 | assert bytes.fromhex('9e876134d90499dd') == ( | 34 | assert bytes.fromhex('9e876134d90499dd') == ( |
| 35 | otp2289.OTPGenerator.tokens_to_bytes('INCH SEA ANNE LONG AHEM TOUR') | 35 | otp2289.OTPResponse.tokens_to_bytes('INCH SEA ANNE LONG AHEM TOUR') |
| 36 | ) | 36 | ) |
| 37 | assert bytes.fromhex('7965e05436f5029f') == ( | 37 | assert bytes.fromhex('7965e05436f5029f') == ( |
| 38 | otp2289.OTPGenerator.tokens_to_bytes('EASE OIL FUM CURE AWRY AVIS') | 38 | otp2289.OTPResponse.tokens_to_bytes('EASE OIL FUM CURE AWRY AVIS') |
| 39 | ) | 39 | ) |
| 40 | assert bytes.fromhex('50fe1962c4965880') == ( | 40 | assert bytes.fromhex('50fe1962c4965880') == ( |
| 41 | otp2289.OTPGenerator.tokens_to_bytes('BAIL TUFT BITS GANG CHEF THY') | 41 | otp2289.OTPResponse.tokens_to_bytes('BAIL TUFT BITS GANG CHEF THY') |
| 42 | ) | 42 | ) |
| 43 | assert bytes.fromhex('87066dd9644bf206') == ( | 43 | assert bytes.fromhex('87066dd9644bf206') == ( |
| 44 | otp2289.OTPGenerator.tokens_to_bytes('FULL PEW DOWN ONCE MORT ARC') | 44 | otp2289.OTPResponse.tokens_to_bytes('FULL PEW DOWN ONCE MORT ARC') |
| 45 | ) | 45 | ) |
| 46 | assert bytes.fromhex('7cd34c1040add14b') == ( | 46 | assert bytes.fromhex('7cd34c1040add14b') == ( |
| 47 | otp2289.OTPGenerator.tokens_to_bytes('FACT HOOF AT FIST SITE KENT') | 47 | otp2289.OTPResponse.tokens_to_bytes('FACT HOOF AT FIST SITE KENT') |
| 48 | ) | 48 | ) |
| 49 | assert bytes.fromhex('5aa37a81f212146c') == ( | 49 | assert bytes.fromhex('5aa37a81f212146c') == ( |
| 50 | otp2289.OTPGenerator.tokens_to_bytes('BODE HOP JAKE STOW JUT RAP') | 50 | otp2289.OTPResponse.tokens_to_bytes('BODE HOP JAKE STOW JUT RAP') |
| 51 | ) | 51 | ) |
| 52 | assert bytes.fromhex('f205753943de4cf9') == ( | 52 | assert bytes.fromhex('f205753943de4cf9') == ( |
| 53 | otp2289.OTPGenerator.tokens_to_bytes('ULAN NEW ARMY FUSE SUIT EYED') | 53 | otp2289.OTPResponse.tokens_to_bytes('ULAN NEW ARMY FUSE SUIT EYED') |
| 54 | ) | 54 | ) |
| 55 | assert bytes.fromhex('ddcdac956f234937') == ( | 55 | assert bytes.fromhex('ddcdac956f234937') == ( |
| 56 | otp2289.OTPGenerator.tokens_to_bytes('SKIM CULT LOB SLAM POE HOWL') | 56 | otp2289.OTPResponse.tokens_to_bytes('SKIM CULT LOB SLAM POE HOWL') |
| 57 | ) | 57 | ) |
| 58 | assert bytes.fromhex('b203e28fa525be47') == ( | 58 | assert bytes.fromhex('b203e28fa525be47') == ( |
| 59 | otp2289.OTPGenerator.tokens_to_bytes('LONG IVY JULY AJAR BOND LEE') | 59 | otp2289.OTPResponse.tokens_to_bytes('LONG IVY JULY AJAR BOND LEE') |
| 60 | ) | 60 | ) |
| 61 | assert bytes.fromhex('bb9e6ae1979d8ff4') == ( | 61 | assert bytes.fromhex('bb9e6ae1979d8ff4') == ( |
| 62 | otp2289.OTPGenerator.tokens_to_bytes('MILT VARY MAST OK SEES WENT') | 62 | otp2289.OTPResponse.tokens_to_bytes('MILT VARY MAST OK SEES WENT') |
| 63 | ) | 63 | ) |
| 64 | assert bytes.fromhex('63d936639734385b') == ( | 64 | assert bytes.fromhex('63d936639734385b') == ( |
| 65 | otp2289.OTPGenerator.tokens_to_bytes('CART OTTO HIVE ODE VAT NUT') | 65 | otp2289.OTPResponse.tokens_to_bytes('CART OTTO HIVE ODE VAT NUT') |
| 66 | ) | 66 | ) |
| 67 | assert bytes.fromhex('87fec7768b73ccf9') == ( | 67 | assert bytes.fromhex('87fec7768b73ccf9') == ( |
| 68 | otp2289.OTPGenerator.tokens_to_bytes('GAFF WAIT SKID GIG SKY EYED') | 68 | otp2289.OTPResponse.tokens_to_bytes('GAFF WAIT SKID GIG SKY EYED') |
| 69 | ) | 69 | ) |
| 70 | assert bytes.fromhex('ad85f658ebe383c9') == ( | 70 | assert bytes.fromhex('ad85f658ebe383c9') == ( |
| 71 | otp2289.OTPGenerator.tokens_to_bytes('LEST OR HEEL SCOT ROB SUIT') | 71 | otp2289.OTPResponse.tokens_to_bytes('LEST OR HEEL SCOT ROB SUIT') |
| 72 | ) | 72 | ) |
| 73 | assert bytes.fromhex('d07ce229b5cf119b') == ( | 73 | assert bytes.fromhex('d07ce229b5cf119b') == ( |
| 74 | otp2289.OTPGenerator.tokens_to_bytes('RITE TAKE GELD COST TUNE RECK') | 74 | otp2289.OTPResponse.tokens_to_bytes('RITE TAKE GELD COST TUNE RECK') |
| 75 | ) | 75 | ) |
| 76 | assert bytes.fromhex('27bc71035aaf3dc6') == ( | 76 | assert bytes.fromhex('27bc71035aaf3dc6') == ( |
| 77 | otp2289.OTPGenerator.tokens_to_bytes('MAY STAR TIN LYON VEDA STAN') | 77 | otp2289.OTPResponse.tokens_to_bytes('MAY STAR TIN LYON VEDA STAN') |
| 78 | ) | 78 | ) |
| 79 | assert bytes.fromhex('d51f3e99bf8e6f0b') == ( | 79 | assert bytes.fromhex('d51f3e99bf8e6f0b') == ( |
| 80 | otp2289.OTPGenerator.tokens_to_bytes('RUST WELT KICK FELL TAIL FRAU') | 80 | otp2289.OTPResponse.tokens_to_bytes('RUST WELT KICK FELL TAIL FRAU') |
| 81 | ) | 81 | ) |
| 82 | assert bytes.fromhex('82aeb52d943774e4') == ( | 82 | assert bytes.fromhex('82aeb52d943774e4') == ( |
| 83 | otp2289.OTPGenerator.tokens_to_bytes('FLIT DOSE ALSO MEW DRUM DEFY') | 83 | otp2289.OTPResponse.tokens_to_bytes('FLIT DOSE ALSO MEW DRUM DEFY') |
| 84 | ) | 84 | ) |
| 85 | assert bytes.fromhex('4f296a74fe1567ec') == ( | 85 | assert bytes.fromhex('4f296a74fe1567ec') == ( |
| 86 | otp2289.OTPGenerator.tokens_to_bytes('AURA ALOE HURL WING BERG WAIT') | 86 | otp2289.OTPResponse.tokens_to_bytes('AURA ALOE HURL WING BERG WAIT') |
| 87 | ) | 87 | ) |
| 88 | 88 | ||
| 89 | 89 | ||
| @@ -92,4 +92,4 @@ def test_random_bytes() -> None: | |||
| 92 | for _ in range(10): | 92 | for _ in range(10): |
| 93 | rnd_bytes = os.urandom(8) # 64 bits | 93 | rnd_bytes = os.urandom(8) # 64 bits |
| 94 | tokens = otp2289.OTPResponse.bytes_to_tokens(rnd_bytes) | 94 | tokens = otp2289.OTPResponse.bytes_to_tokens(rnd_bytes) |
| 95 | assert rnd_bytes == otp2289.OTPGenerator.tokens_to_bytes(tokens) | 95 | assert rnd_bytes == otp2289.OTPResponse.tokens_to_bytes(tokens) |
