mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
slightly better base58 (still ugly tho)
This commit is contained in:
parent
f666640fff
commit
164f6afb7c
2 changed files with 36 additions and 35 deletions
23
tests/test_base58.py
Normal file
23
tests/test_base58.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import unittest
|
||||
|
||||
from monero.base58 import decode, encode
|
||||
|
||||
|
||||
class Base58EncodeTestCase(unittest.TestCase):
|
||||
def test_encode_empty(self):
|
||||
self.assertEqual(encode(''), '')
|
||||
|
||||
def test_encode_invalid_hex_length(self):
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
encode('abcde')
|
||||
self.assertEqual(str(cm.exception), 'Hex string has invalid length: 5')
|
||||
|
||||
|
||||
class Base58DecodeTestCase(unittest.TestCase):
|
||||
def test_decode_empty(self):
|
||||
self.assertEqual(decode(''), '')
|
||||
|
||||
def test_decode_invalid_length_block(self):
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
decode('f')
|
||||
self.assertEqual(str(cm.exception), 'Invalid encoded length: 1')
|
Loading…
Add table
Add a link
Reference in a new issue