def test_eq(self): self.assertEqual( PrivateAddress('00000000FE00007DF0'), PrivateAddress('00000000FE00007DF0') )
def test_repr(self): self.assertEqual( repr(PrivateAddress('00000000FE00007DF0')), "PrivateAddress(addr='00000000FE00007DF0', hex='A0000000FE00007D')" )
def test_str(self): self.assertEqual( str(PrivateAddress('00000000FE00007DF0')), "00000000FE00007DF0" )
def test_bin_property(self): for addr in TEST_PRIV_ADDRS: with self.subTest(addr=addr): priv = PrivateAddress(addr['addr']) self.assertEqual(priv.bin, bytes.fromhex(addr['hex']))
def test_hex_property(self): for addr in TEST_PRIV_ADDRS: with self.subTest(addr=addr): priv = PrivateAddress(addr['addr']) self.assertEqual(priv.hex, addr['hex'])
def test_from_bin(self): for addr in TEST_PRIV_ADDRS: with self.subTest(addr=addr): priv1 = PrivateAddress.from_bin(addr['hex']) priv2 = PrivateAddress(addr['addr']) self.assertEqual(priv1, priv2)
def test_bin2txt(self): for addr in TEST_PRIV_ADDRS: with self.subTest(addr=addr): txt_addr = PrivateAddress.bin2txt(addr['hex']) self.assertEqual(txt_addr, addr['addr'])
def test_txt2bin(self): for addr in TEST_PRIV_ADDRS: with self.subTest(addr=addr): hex_addr = PrivateAddress.txt2bin(addr['addr']) self.assertEqual(hex_addr, addr['hex'])