From 93c7cfbf63d13b4d735c0d08b69f80c310f3bfac Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 3 Nov 2021 17:14:18 +0200 Subject: [PATCH] test_base58: added tests for a single character, zero and invalid data --- src/tests/test_addresses.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/test_addresses.py b/src/tests/test_addresses.py index a706f2f6..8f9c283d 100644 --- a/src/tests/test_addresses.py +++ b/src/tests/test_addresses.py @@ -46,11 +46,15 @@ class TestAddresses(unittest.TestCase): def test_base58(self): """Check Base58 encoding and decoding""" + self.assertEqual(addresses.decodeBase58('1'), 0) + self.assertEqual(addresses.decodeBase58('!'), 0) self.assertEqual( addresses.decodeBase58(sample_addr4), sample_daddr4_512) self.assertEqual( addresses.decodeBase58(sample_addr3), sample_daddr3_512) + self.assertEqual(addresses.encodeBase58(0), '1') + self.assertEqual(addresses.encodeBase58(-1), None) self.assertEqual( sample_addr4, addresses.encodeBase58(sample_daddr4_512)) self.assertEqual(