diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-10-16 22:04:41 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-10-16 22:04:41 (GMT) |
commit | cc53c9b1124b464556ba29a4a91a33628b3efe14 (patch) | |
tree | 36938b81248690a41fb3baa4e55a8dc643afdfc7 /tests/plugins/encodings | |
parent | 015a0f3979b24f222317b305b056211515f9a64f (diff) |
Fix some bugs in the base64 implementation.
Diffstat (limited to 'tests/plugins/encodings')
-rw-r--r-- | tests/plugins/encodings/all.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/plugins/encodings/all.py b/tests/plugins/encodings/all.py new file mode 100644 index 0000000..a856ccb --- /dev/null +++ b/tests/plugins/encodings/all.py @@ -0,0 +1,23 @@ + +from chrysacase import ChrysalideTestCase +from pychrysalide.plugins import encodings + +import base64 + + +class TestEncodingsModule(ChrysalideTestCase): + """TestCase for encodings plugin.""" + + def testBase64Encoding(self): + """Validate the base64 implementation.""" + + text = '0123456789abcdef' + + for i in range(len(text) + 1): + + src = text[:i].encode('ascii') + + encoded = encodings.base64_encode(src) + ref = base64.b64encode(src) + + self.assertEqual(encoded, ref) |