summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-31 11:46:51 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-17 10:45:07 -0500
commitcebd0d7ad54995c37f68586a14540ad64d99d762 (patch)
treeac4de894cd8ed43d33890180cfc09cf3a0f90249 /testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py
parent45c7bbf24ae3c6530f33ebb33c062818ad44816d (diff)
downloadbcfg2-cebd0d7ad54995c37f68586a14540ad64d99d762.tar.gz
bcfg2-cebd0d7ad54995c37f68586a14540ad64d99d762.tar.bz2
bcfg2-cebd0d7ad54995c37f68586a14540ad64d99d762.zip
fixed unit tests
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py')
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py
index 2e1d6df51..958dba4ff 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py
@@ -16,7 +16,6 @@ while path != "/":
break
path = os.path.dirname(path)
from common import *
-from Bcfg2.Server.FileMonitor import _FAM
from Bcfg2.Server.Plugins.Probes import *
from TestPlugin import TestEntrySet, TestProbing, TestConnector, \
TestDatabaseBacked
@@ -101,14 +100,11 @@ class TestProbeSet(TestEntrySet):
rv.entry_type = MagicMock()
return rv
- def test__init(self):
- fam = Bcfg2.Server.FileMonitor._FAM
- Bcfg2.Server.FileMonitor._FAM = Mock()
+ @patch("Bcfg2.Server.FileMonitor.get_fam")
+ def test__init(self, mock_get_fam):
ps = self.get_obj()
self.assertEqual(ps.plugin_name, "Probes")
- Bcfg2.Server.FileMonitor._FAM.AddMonitor.assert_called_with(datastore,
- ps)
- Bcfg2.Server.FileMonitor._FAM = fam
+ mock_get_fam.return_value.AddMonitor.assert_called_with(datastore, ps)
TestEntrySet.test__init(self)
def test_HandleEvent(self):
@@ -258,9 +254,6 @@ text
def test__init(self):
mock_load_data = Mock()
probes = self.get_probes_object(load_data=mock_load_data)
- _FAM.AddMonitor.assert_called_with(os.path.join(datastore,
- probes.name),
- probes.probes)
mock_load_data.assert_any_call()
self.assertEqual(probes.probedata, ClientProbeDataSet())
self.assertEqual(probes.cgroups, dict())