summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-04-24 15:44:06 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-04-25 10:45:14 -0400
commit044213c789c4f1ee214da3d70f02352b1aaa8673 (patch)
treefeb62ab035d27773f20be1e052a177c0c61299aa /testsuite
parent0ff6b2788de683dd89203c7ae1393ea922a62c32 (diff)
downloadbcfg2-044213c789c4f1ee214da3d70f02352b1aaa8673.tar.gz
bcfg2-044213c789c4f1ee214da3d70f02352b1aaa8673.tar.bz2
bcfg2-044213c789c4f1ee214da3d70f02352b1aaa8673.zip
Fixing unit tests
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py8
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py6
2 files changed, 6 insertions, 8 deletions
diff --git a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py
index 2dc763730..df7b7c217 100644
--- a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py
+++ b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py
@@ -520,14 +520,14 @@ class TestSvcTool(TestTool):
st.get_svc_command.reset_mock()
st.cmd.reset_mock()
- self.assertEqual(st.check_service(service),
- st.cmd.run.return_value)
+ st.cmd.run.return_value = True
+ self.assertEqual(st.check_service(service), True)
st.get_svc_command.assert_called_with(service, "status")
st.cmd.run.assert_called_with(st.get_svc_command.return_value)
reset()
- self.assertEqual(st.check_service(service),
- st.cmd.run.return_value)
+ st.cmd.run.return_value = False
+ self.assertEqual(st.check_service(service), False)
st.get_svc_command.assert_called_with(service, "status")
st.cmd.run.assert_called_with(st.get_svc_command.return_value)
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
index 6cfd2f666..48d5cdbfe 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
@@ -66,8 +66,7 @@ class TestCfgPrivateKeyCreator(TestCfgCreator, TestStructFile):
pkc.setup.cfp.get.assert_called_with("sshkeys", "category")
@skipUnless(HAS_CRYPTO, "No crypto libraries found, skipping")
- @patchIf(HAS_CRYPTO,
- "Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator.get_passphrases")
+ @patchIf(HAS_CRYPTO, "Bcfg2.Server.Encryption.get_passphrases")
def test_passphrase(self, mock_get_passphrases):
pkc = self.get_obj()
pkc.setup = Mock()
@@ -279,7 +278,7 @@ class TestCfgPrivateKeyCreator(TestCfgCreator, TestStructFile):
if HAS_CRYPTO:
@patch(passphrase, "foo")
- @patch("Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator.ssl_encrypt")
+ @patch("Bcfg2.Server.Encryption.ssl_encrypt")
def inner2(mock_ssl_encrypt):
reset()
mock_ssl_encrypt.return_value = "encryptedprivatekey"
@@ -303,4 +302,3 @@ class TestCfgPrivateKeyCreator(TestCfgCreator, TestStructFile):
mock_rmtree.assert_called_with(datastore)
inner2()
-