summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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)