summaryrefslogtreecommitdiff
path: root/pgpwordlist/funcs_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'pgpwordlist/funcs_tests.py')
-rw-r--r--pgpwordlist/funcs_tests.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/pgpwordlist/funcs_tests.py b/pgpwordlist/funcs_tests.py
index 5473ac8..2697e43 100644
--- a/pgpwordlist/funcs_tests.py
+++ b/pgpwordlist/funcs_tests.py
@@ -31,9 +31,9 @@ class WordListQueriesTests(unittest.TestCase):
even_words = set()
odd_words = set()
for i in range(256):
- hex = '%02x' % i
- even_word = pgpwordlist.get_word(hex, 0)
- odd_word = pgpwordlist.get_word(hex, 1)
+ hexstr = '%02x' % i
+ even_word = pgpwordlist.get_word(hexstr, 0)
+ odd_word = pgpwordlist.get_word(hexstr, 1)
self.assertNotIn(even_word, even_words)
self.assertNotIn(odd_word, odd_words)
even_words.add(even_word)
@@ -41,16 +41,16 @@ class WordListQueriesTests(unittest.TestCase):
def test_round_trip_works(self):
for i in range(256):
- hex = '%02x' % i
- even_word = pgpwordlist.get_word(hex, 0)
- odd_word = pgpwordlist.get_word(hex, 1)
- self.assertEqual(pgpwordlist.get_hex(even_word), hex)
- self.assertEqual(pgpwordlist.get_hex(odd_word), hex)
+ hexstr = '%02x' % i
+ even_word = pgpwordlist.get_word(hexstr, 0)
+ odd_word = pgpwordlist.get_word(hexstr, 1)
+ self.assertEqual(pgpwordlist.get_hex(even_word), hexstr)
+ self.assertEqual(pgpwordlist.get_hex(odd_word), hexstr)
class WordStringTests(unittest.TestCase):
def test_roundtrip_works(self):
- hex = 'cafef00d'
- words = pgpwordlist.hex_to_words(hex)
- self.assertEqual(pgpwordlist.words_to_hex(words), hex)
+ hexstr = 'cafef00d'
+ words = pgpwordlist.hex_to_words(hexstr)
+ self.assertEqual(pgpwordlist.words_to_hex(words), hexstr)