Commit 4f066126 authored by Christian Heimes's avatar Christian Heimes

Enabled fromhex('') test for bytes

parent 5f63d186
...@@ -242,9 +242,7 @@ class BaseBytesTest(unittest.TestCase): ...@@ -242,9 +242,7 @@ class BaseBytesTest(unittest.TestCase):
def test_fromhex(self): def test_fromhex(self):
self.assertRaises(TypeError, self.type2test.fromhex) self.assertRaises(TypeError, self.type2test.fromhex)
self.assertRaises(TypeError, self.type2test.fromhex, 1) self.assertRaises(TypeError, self.type2test.fromhex, 1)
# To be fixed self.assertEquals(self.type2test.fromhex(''), self.type2test())
if self.type2test != bytes:
self.assertEquals(self.type2test.fromhex(''), self.type2test())
b = bytearray([0x1a, 0x2b, 0x30]) b = bytearray([0x1a, 0x2b, 0x30])
self.assertEquals(self.type2test.fromhex('1a2B30'), b) self.assertEquals(self.type2test.fromhex('1a2B30'), b)
self.assertEquals(self.type2test.fromhex(' 1A 2B 30 '), b) self.assertEquals(self.type2test.fromhex(' 1A 2B 30 '), b)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment