def _check_list(self, language, vectors): mnemo = Mnemonic(language) for v in vectors: code = mnemo.encode(unhexlify(v[0])) data = hexlify(mnemo.decode(code)) self.assertEqual(v[1], code) self.assertEqual(v[0], data) print "input: ", v[0], "(%d bits)" % len(v[0] * 4) print "mnemonic:", code, "(%d words)" % len(code.split(' ')) print
def test_failed_checksum(self): code = 'bless cloud wheel regular tiny venue bird web grief security dignity language' mnemo = Mnemonic('english') with self.assertRaises(Exception): mnemo.decode(code)