Added failure test case for password decryption
Added skeletal tests for other util methods


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ebf9e0b5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ebf9e0b5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ebf9e0b5

Branch: refs/heads/master
Commit: ebf9e0b53ca8848c66e29879428bd110d9444c8e
Parents: 5493e99
Author: Chamila de Alwis <[email protected]>
Authored: Tue Oct 21 09:57:19 2014 +0530
Committer: Chamila de Alwis <[email protected]>
Committed: Tue Oct 21 09:57:19 2014 +0530

----------------------------------------------------------------------
 tools/python_cartridgeagent/test/test_util.py | 30 ++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ebf9e0b5/tools/python_cartridgeagent/test/test_util.py
----------------------------------------------------------------------
diff --git a/tools/python_cartridgeagent/test/test_util.py 
b/tools/python_cartridgeagent/test/test_util.py
index 63e93cf..2b4186e 100644
--- a/tools/python_cartridgeagent/test/test_util.py
+++ b/tools/python_cartridgeagent/test/test_util.py
@@ -41,7 +41,7 @@ class TestTask(AbstractAsyncScheduledTask):
             f.write("%1.4f" % (time.time()*1000))
 
 
-def test_decrypt_password():
+def test_decrypt_password_success():
     # def mockgetlog(path):
     #     return mocklog
     #
@@ -52,4 +52,30 @@ def test_decrypt_password():
     secret_key = "tvnw63ufg9gh5111"
     encrypted_password= "jP1lZ5xMlpLzu8MbY2Porg=="
 
-    assert cartridgeagentutils.decrypt_password(encrypted_password, 
secret_key) == plain_password, "Password decryption failed"
\ No newline at end of file
+    assert cartridgeagentutils.decrypt_password(encrypted_password, 
secret_key) == plain_password, "Password decryption failed"
+
+
+def test_decrypt_password_failure():
+    plain_password = "plaintext"
+    secret_key = "notsecretkeyhere"
+    encrypted_password= "jP1lZ5xMlpLzu8MbY2Porg=="
+    assert cartridgeagentutils.decrypt_password(encrypted_password, 
secret_key) != plain_password, "Password decrypted for wrong key"
+
+
+def test_create_dir_normal():
+    assert True
+
+def test_create_dir_system_path():
+    assert True
+
+def test_create_dir_existing_dir():
+    assert True
+
+def test_wait_for_ports_activity_normal():
+    assert True
+
+def test_wait_for_ports_activity_non_existent():
+    assert True
+
+def test_wait_for_ports_activity_timeout():
+    assert True
\ No newline at end of file

Reply via email to