diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 13:31:21 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 13:31:21 -0400 |
commit | 9c603d8267c0a511968a8a553d7fa0b2d5bf9b73 (patch) | |
tree | c473a7615586dc22d585bda67e118ed2fe535754 /testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py | |
parent | 3dc289678812238c2fcc54098b1d8de9bf64f900 (diff) | |
download | bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.tar.gz bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.tar.bz2 bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.zip |
Handle FAM monitor failures more gracefully:
* Where possible, create the file or directory that is about to be
monitored. This ensures that content can be added later without
need to restart Bcfg2. (Otherwise, adding the monitor would fail,
and so when you did create the file in question, bcfg2-server would
never be notified of it.)
* When not possible, give better error messages.
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py index 899fb24a0..2163aa037 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py @@ -201,9 +201,7 @@ class TestProbes(TestProbing, TestConnector, TestDatabaseBacked): test_obj = Probes def get_obj(self, core=None): - if core is None: - core = MagicMock() - return self.test_obj(core, datastore) + return TestDatabaseBacked.get_obj(self, core=core) def get_test_probedata(self): test_xdata = lxml.etree.Element("test") @@ -247,9 +245,10 @@ text # test__init(), which relies on being able to check the calls # of load_data(), and thus on load_data() being consistently # mocked) - @patch("Bcfg2.Server.Plugins.Probes.Probes.load_data", new=load_data) + @patch("%s.%s.load_data" % (self.test_obj.__module__, + self.test_obj.__name__), new=load_data) def inner(): - return Probes(core, datastore) + return self.get_obj(core) return inner() |