diff options
| author | Simeon Simeonov | 2022-03-29 20:44:03 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2022-03-29 20:44:03 +0200 |
| commit | f19fde48c6b3f65c164c931286e72a0d254c1fb3 (patch) | |
| tree | 5b6c1bf6cef51c852c49abff3a0e4626e8a33146 /tests/test_static.py | |
| parent | 12c5e38691b24d12a8fc9605e3b93fac86d461ae (diff) | |
Add the -P param and improve tests
Diffstat (limited to 'tests/test_static.py')
| -rw-r--r-- | tests/test_static.py | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/tests/test_static.py b/tests/test_static.py index dc6e2d7..a942374 100644 --- a/tests/test_static.py +++ b/tests/test_static.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020, Simeon Simeonov | 4 | # Copyright (c) 2020-2022, Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
| @@ -33,42 +33,59 @@ import otp2289 | |||
| 33 | def test_bytes_and_tokens(): | 33 | def test_bytes_and_tokens(): |
| 34 | """Tests the official hex and tokens defined in RFC2289""" | 34 | """Tests the official hex and tokens defined in RFC2289""" |
| 35 | assert binascii.unhexlify('9e876134d90499dd') == ( | 35 | assert binascii.unhexlify('9e876134d90499dd') == ( |
| 36 | otp2289.OTPGenerator.tokens_to_bytes('INCH SEA ANNE LONG AHEM TOUR')) | 36 | otp2289.OTPGenerator.tokens_to_bytes('INCH SEA ANNE LONG AHEM TOUR') |
| 37 | ) | ||
| 37 | assert binascii.unhexlify('7965e05436f5029f') == ( | 38 | assert binascii.unhexlify('7965e05436f5029f') == ( |
| 38 | otp2289.OTPGenerator.tokens_to_bytes('EASE OIL FUM CURE AWRY AVIS')) | 39 | otp2289.OTPGenerator.tokens_to_bytes('EASE OIL FUM CURE AWRY AVIS') |
| 40 | ) | ||
| 39 | assert binascii.unhexlify('50fe1962c4965880') == ( | 41 | assert binascii.unhexlify('50fe1962c4965880') == ( |
| 40 | otp2289.OTPGenerator.tokens_to_bytes('BAIL TUFT BITS GANG CHEF THY')) | 42 | otp2289.OTPGenerator.tokens_to_bytes('BAIL TUFT BITS GANG CHEF THY') |
| 43 | ) | ||
| 41 | assert binascii.unhexlify('87066dd9644bf206') == ( | 44 | assert binascii.unhexlify('87066dd9644bf206') == ( |
| 42 | otp2289.OTPGenerator.tokens_to_bytes('FULL PEW DOWN ONCE MORT ARC')) | 45 | otp2289.OTPGenerator.tokens_to_bytes('FULL PEW DOWN ONCE MORT ARC') |
| 46 | ) | ||
| 43 | assert binascii.unhexlify('7cd34c1040add14b') == ( | 47 | assert binascii.unhexlify('7cd34c1040add14b') == ( |
| 44 | otp2289.OTPGenerator.tokens_to_bytes('FACT HOOF AT FIST SITE KENT')) | 48 | otp2289.OTPGenerator.tokens_to_bytes('FACT HOOF AT FIST SITE KENT') |
| 49 | ) | ||
| 45 | assert binascii.unhexlify('5aa37a81f212146c') == ( | 50 | assert binascii.unhexlify('5aa37a81f212146c') == ( |
| 46 | otp2289.OTPGenerator.tokens_to_bytes('BODE HOP JAKE STOW JUT RAP')) | 51 | otp2289.OTPGenerator.tokens_to_bytes('BODE HOP JAKE STOW JUT RAP') |
| 52 | ) | ||
| 47 | assert binascii.unhexlify('f205753943de4cf9') == ( | 53 | assert binascii.unhexlify('f205753943de4cf9') == ( |
| 48 | otp2289.OTPGenerator.tokens_to_bytes('ULAN NEW ARMY FUSE SUIT EYED')) | 54 | otp2289.OTPGenerator.tokens_to_bytes('ULAN NEW ARMY FUSE SUIT EYED') |
| 55 | ) | ||
| 49 | assert binascii.unhexlify('ddcdac956f234937') == ( | 56 | assert binascii.unhexlify('ddcdac956f234937') == ( |
| 50 | otp2289.OTPGenerator.tokens_to_bytes('SKIM CULT LOB SLAM POE HOWL')) | 57 | otp2289.OTPGenerator.tokens_to_bytes('SKIM CULT LOB SLAM POE HOWL') |
| 58 | ) | ||
| 51 | assert binascii.unhexlify('b203e28fa525be47') == ( | 59 | assert binascii.unhexlify('b203e28fa525be47') == ( |
| 52 | otp2289.OTPGenerator.tokens_to_bytes('LONG IVY JULY AJAR BOND LEE')) | 60 | otp2289.OTPGenerator.tokens_to_bytes('LONG IVY JULY AJAR BOND LEE') |
| 53 | 61 | ) | |
| 54 | assert binascii.unhexlify('bb9e6ae1979d8ff4') == ( | 62 | assert binascii.unhexlify('bb9e6ae1979d8ff4') == ( |
| 55 | otp2289.OTPGenerator.tokens_to_bytes('MILT VARY MAST OK SEES WENT')) | 63 | otp2289.OTPGenerator.tokens_to_bytes('MILT VARY MAST OK SEES WENT') |
| 64 | ) | ||
| 56 | assert binascii.unhexlify('63d936639734385b') == ( | 65 | assert binascii.unhexlify('63d936639734385b') == ( |
| 57 | otp2289.OTPGenerator.tokens_to_bytes('CART OTTO HIVE ODE VAT NUT')) | 66 | otp2289.OTPGenerator.tokens_to_bytes('CART OTTO HIVE ODE VAT NUT') |
| 67 | ) | ||
| 58 | assert binascii.unhexlify('87fec7768b73ccf9') == ( | 68 | assert binascii.unhexlify('87fec7768b73ccf9') == ( |
| 59 | otp2289.OTPGenerator.tokens_to_bytes('GAFF WAIT SKID GIG SKY EYED')) | 69 | otp2289.OTPGenerator.tokens_to_bytes('GAFF WAIT SKID GIG SKY EYED') |
| 70 | ) | ||
| 60 | assert binascii.unhexlify('ad85f658ebe383c9') == ( | 71 | assert binascii.unhexlify('ad85f658ebe383c9') == ( |
| 61 | otp2289.OTPGenerator.tokens_to_bytes('LEST OR HEEL SCOT ROB SUIT')) | 72 | otp2289.OTPGenerator.tokens_to_bytes('LEST OR HEEL SCOT ROB SUIT') |
| 73 | ) | ||
| 62 | assert binascii.unhexlify('d07ce229b5cf119b') == ( | 74 | assert binascii.unhexlify('d07ce229b5cf119b') == ( |
| 63 | otp2289.OTPGenerator.tokens_to_bytes('RITE TAKE GELD COST TUNE RECK')) | 75 | otp2289.OTPGenerator.tokens_to_bytes('RITE TAKE GELD COST TUNE RECK') |
| 76 | ) | ||
| 64 | assert binascii.unhexlify('27bc71035aaf3dc6') == ( | 77 | assert binascii.unhexlify('27bc71035aaf3dc6') == ( |
| 65 | otp2289.OTPGenerator.tokens_to_bytes('MAY STAR TIN LYON VEDA STAN')) | 78 | otp2289.OTPGenerator.tokens_to_bytes('MAY STAR TIN LYON VEDA STAN') |
| 79 | ) | ||
| 66 | assert binascii.unhexlify('d51f3e99bf8e6f0b') == ( | 80 | assert binascii.unhexlify('d51f3e99bf8e6f0b') == ( |
| 67 | otp2289.OTPGenerator.tokens_to_bytes('RUST WELT KICK FELL TAIL FRAU')) | 81 | otp2289.OTPGenerator.tokens_to_bytes('RUST WELT KICK FELL TAIL FRAU') |
| 82 | ) | ||
| 68 | assert binascii.unhexlify('82aeb52d943774e4') == ( | 83 | assert binascii.unhexlify('82aeb52d943774e4') == ( |
| 69 | otp2289.OTPGenerator.tokens_to_bytes('FLIT DOSE ALSO MEW DRUM DEFY')) | 84 | otp2289.OTPGenerator.tokens_to_bytes('FLIT DOSE ALSO MEW DRUM DEFY') |
| 85 | ) | ||
| 70 | assert binascii.unhexlify('4f296a74fe1567ec') == ( | 86 | assert binascii.unhexlify('4f296a74fe1567ec') == ( |
| 71 | otp2289.OTPGenerator.tokens_to_bytes('AURA ALOE HURL WING BERG WAIT')) | 87 | otp2289.OTPGenerator.tokens_to_bytes('AURA ALOE HURL WING BERG WAIT') |
| 88 | ) | ||
| 72 | 89 | ||
| 73 | 90 | ||
| 74 | def test_random_bytes(): | 91 | def test_random_bytes(): |
