|
@ -125,13 +125,23 @@ class TestUtil(ElectrumTestCase): |
|
|
|
|
|
|
|
|
def test_is_hex_str(self): |
|
|
def test_is_hex_str(self): |
|
|
self.assertTrue(is_hex_str('09a4')) |
|
|
self.assertTrue(is_hex_str('09a4')) |
|
|
|
|
|
self.assertTrue(is_hex_str('abCD')) |
|
|
self.assertTrue(is_hex_str('2A5C3F4062E4F2FCCE7A1C7B4310CB647B327409F580F4ED72CB8FC0B1804DFA')) |
|
|
self.assertTrue(is_hex_str('2A5C3F4062E4F2FCCE7A1C7B4310CB647B327409F580F4ED72CB8FC0B1804DFA')) |
|
|
self.assertTrue(is_hex_str('00' * 33)) |
|
|
self.assertTrue(is_hex_str('00' * 33)) |
|
|
|
|
|
|
|
|
|
|
|
self.assertFalse(is_hex_str('0x09a4')) |
|
|
|
|
|
self.assertFalse(is_hex_str('2A 5C3F')) |
|
|
|
|
|
self.assertFalse(is_hex_str(' 2A5C3F')) |
|
|
|
|
|
self.assertFalse(is_hex_str('2A5C3F ')) |
|
|
self.assertFalse(is_hex_str('000')) |
|
|
self.assertFalse(is_hex_str('000')) |
|
|
|
|
|
self.assertFalse(is_hex_str('123')) |
|
|
|
|
|
self.assertFalse(is_hex_str('0x123')) |
|
|
self.assertFalse(is_hex_str('qweqwe')) |
|
|
self.assertFalse(is_hex_str('qweqwe')) |
|
|
|
|
|
self.assertFalse(is_hex_str(b'09a4')) |
|
|
|
|
|
self.assertFalse(is_hex_str(b'\x09\xa4')) |
|
|
self.assertFalse(is_hex_str(None)) |
|
|
self.assertFalse(is_hex_str(None)) |
|
|
self.assertFalse(is_hex_str(7)) |
|
|
self.assertFalse(is_hex_str(7)) |
|
|
|
|
|
self.assertFalse(is_hex_str(7.2)) |
|
|
|
|
|
|
|
|
def test_is_integer(self): |
|
|
def test_is_integer(self): |
|
|
self.assertTrue(is_integer(7)) |
|
|
self.assertTrue(is_integer(7)) |
|
|