chiark / gitweb /
update test: replace decode('hex') with unhexlify
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Jan 2016 20:31:22 +0000 (21:31 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 11 Mar 2016 13:27:00 +0000 (13:27 +0000)
tests/update.TestCase

index 647c8d5690529e1021165a23765d3b4f4dbb32d3..83349f5e74593d93c5f4603c14915ca7c4ff7e8b 100755 (executable)
@@ -8,6 +8,7 @@ import optparse
 import os
 import sys
 import unittest
+from binascii import unhexlify
 
 localmodule = os.path.realpath(
     os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
@@ -55,7 +56,7 @@ class UpdateTest(unittest.TestCase):
         self.assertEquals(len(sig), len(pysig),
                           "the length of the two sigs are different!")
         try:
-            self.assertEquals(sig.decode('hex'), pysig.decode('hex'),
+            self.assertEquals(unhexlify(sig), unhexlify(pysig),
                               "the length of the two sigs are different!")
         except TypeError as e:
             print(e)