summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-16 22:04:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-16 22:04:41 (GMT)
commitcc53c9b1124b464556ba29a4a91a33628b3efe14 (patch)
tree36938b81248690a41fb3baa4e55a8dc643afdfc7 /tests
parent015a0f3979b24f222317b305b056211515f9a64f (diff)
Fix some bugs in the base64 implementation.
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/encodings/all.py23
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)