summaryrefslogtreecommitdiff
path: root/pgpwordlist/funcs_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-12-31 22:10:12 +0200
committerLars Wirzenius <liw@liw.fi>2016-12-31 22:10:12 +0200
commit9e4095e8b75f7235ea5dfef48f06cfef116692d3 (patch)
tree79be1b0560404712a4ce35935aa519d473cb2df0 /pgpwordlist/funcs_tests.py
parent23683ca2bc1d9dd07e4ebee6ba348a5e7eaee1bb (diff)
downloadpy_pgpwordlist-9e4095e8b75f7235ea5dfef48f06cfef116692d3.tar.gz
Add hex_to_words and words_to_hex
Diffstat (limited to 'pgpwordlist/funcs_tests.py')
-rw-r--r--pgpwordlist/funcs_tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pgpwordlist/funcs_tests.py b/pgpwordlist/funcs_tests.py
index a7d1bfb..5473ac8 100644
--- a/pgpwordlist/funcs_tests.py
+++ b/pgpwordlist/funcs_tests.py
@@ -46,3 +46,11 @@ class WordListQueriesTests(unittest.TestCase):
odd_word = pgpwordlist.get_word(hex, 1)
self.assertEqual(pgpwordlist.get_hex(even_word), hex)
self.assertEqual(pgpwordlist.get_hex(odd_word), hex)
+
+
+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)