test_base58: added tests for a single character, zero and invalid data
This commit is contained in:
parent
8a5d90f200
commit
93c7cfbf63
|
@ -46,11 +46,15 @@ class TestAddresses(unittest.TestCase):
|
||||||
|
|
||||||
def test_base58(self):
|
def test_base58(self):
|
||||||
"""Check Base58 encoding and decoding"""
|
"""Check Base58 encoding and decoding"""
|
||||||
|
self.assertEqual(addresses.decodeBase58('1'), 0)
|
||||||
|
self.assertEqual(addresses.decodeBase58('!'), 0)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
addresses.decodeBase58(sample_addr4), sample_daddr4_512)
|
addresses.decodeBase58(sample_addr4), sample_daddr4_512)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
addresses.decodeBase58(sample_addr3), sample_daddr3_512)
|
addresses.decodeBase58(sample_addr3), sample_daddr3_512)
|
||||||
|
|
||||||
|
self.assertEqual(addresses.encodeBase58(0), '1')
|
||||||
|
self.assertEqual(addresses.encodeBase58(-1), None)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sample_addr4, addresses.encodeBase58(sample_daddr4_512))
|
sample_addr4, addresses.encodeBase58(sample_daddr4_512))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
Reference in New Issue
Block a user