summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/tests
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-07-19 16:55:55 -0400
committerDR695H <dr695h@att.com>2019-07-19 17:50:32 -0400
commit4c8dc6a28644cbd44084296907d54c66b447432e (patch)
tree7d98c75cee99ad3891bebc79847db0d0a1d95ae9 /robotframework-onap/tests
parent601ead6cc5e04f276d57d118e1d94d1366278a24 (diff)
fixing is not none
Issue-ID: TEST-174 Change-Id: I1b48d6f6839cdbb4df5eb6461ac1a053fcdfbc57 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/tests')
-rw-r--r--robotframework-onap/tests/ONAPLibrary/Base64KeywordsTests.py16
-rw-r--r--robotframework-onap/tests/runner.py2
2 files changed, 18 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"))
diff --git a/robotframework-onap/tests/runner.py b/robotframework-onap/tests/runner.py
index d1b217a..f9a57f5 100644
--- a/robotframework-onap/tests/runner.py
+++ b/robotframework-onap/tests/runner.py
@@ -7,6 +7,7 @@ from tests.vcpeutils.SoUtils_test import SoUtilsTest
from tests.ONAPLibrary.ProtobufKeywordsTest import ProtobufKeywordsTest
from tests.ONAPLibrary.UUIDKeywordsTest import UUIDKeywordsTest
from tests.ONAPLibrary.ServiceMappingKeywordsTests import ServiceMappingKeywordsTests
+from tests.ONAPLibrary.Base64KeywordsTests import Base64KeywordsTests
# initialize the test suite
loader = TestLoader()
@@ -17,6 +18,7 @@ suite.addTests(loader.loadTestsFromTestCase(ProtobufKeywordsTest))
suite.addTests(loader.loadTestsFromTestCase(SoUtilsTest))
suite.addTests(loader.loadTestsFromTestCase(UUIDKeywordsTest))
suite.addTests(loader.loadTestsFromTestCase(ServiceMappingKeywordsTests))
+suite.addTests(loader.loadTestsFromTestCase(Base64KeywordsTests))
# initialize a runner, pass it your suite and run it
runner = TextTestRunner(verbosity=3)