diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-12-31 22:59:17 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-12-31 22:59:17 +0200 |
commit | bdb0f645bc1bd040cf87be6247fb9f89e9b52f17 (patch) | |
tree | 39ec1278d2dca8b9619eab486ee9fae6b2bdc432 /pgpwordlist/funcs_tests.py | |
parent | d7b781438d11215f1ff887e108da26fea9640c89 (diff) | |
download | py_pgpwordlist-bdb0f645bc1bd040cf87be6247fb9f89e9b52f17.tar.gz |
Fix names to not override builtin hex
Diffstat (limited to 'pgpwordlist/funcs_tests.py')
-rw-r--r-- | pgpwordlist/funcs_tests.py | 22 |
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) |