summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py')
-rw-r--r--robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py b/robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py
new file mode 100644
index 0000000..4c63591
--- /dev/null
+++ b/robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py
@@ -0,0 +1,16 @@
+import base64
+from unittest import TestCase
+
+from ONAPLibrary.Base64Keywords import Base64Keywords
+
+
+class Base64KeywordsTests(TestCase):
+
+ def test_base64_encode(self):
+ enc = Base64Keywords().base64_encode("string_to_encode")
+ enc_base = base64.b64encode("string_to_encode".encode("utf-8"))
+ self.assertEqual(enc_base, enc)
+
+ def test_base64_decode(self):
+ enc = Base64Keywords().base64_decode('c3RyaW5nX3RvX2RlY29kZQ==')
+ self.assertEqual("string_to_decode", enc.decode("utf-8"))