diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-07 08:10:31 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-07 08:10:31 -0400 |
commit | c83391555c0773a02dfd9fd482b3415c5bba4104 (patch) | |
tree | 870f3e46611a7141e91b8d131d48ee0b3d0fcfa3 /testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py | |
parent | e0d21baa9fc07a872f6264a95fbcb3ccb46d08f1 (diff) | |
download | bcfg2-c83391555c0773a02dfd9fd482b3415c5bba4104.tar.gz bcfg2-c83391555c0773a02dfd9fd482b3415c5bba4104.tar.bz2 bcfg2-c83391555c0773a02dfd9fd482b3415c5bba4104.zip |
testsuite: fixed patch scoping issues in py3k
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py index 9f2f618c9..4b2f1981f 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py @@ -28,21 +28,21 @@ class TestDebuggable(Bcfg2TestCase): self.assertIsInstance(d.logger, logging.Logger) self.assertFalse(d.debug_flag) - @patch("Bcfg2.Server.Plugin.base.%s.debug_log" % test_obj.__name__) - def test_toggle_debug(self, mock_debug): + def test_toggle_debug(self): d = self.get_obj() + d.debug_log = Mock() orig = d.debug_flag d.toggle_debug() self.assertNotEqual(orig, d.debug_flag) - self.assertTrue(mock_debug.called) + self.assertTrue(d.debug_log.called) - mock_debug.reset_mock() + d.debug_log.reset_mock() changed = d.debug_flag d.toggle_debug() self.assertNotEqual(changed, d.debug_flag) self.assertEqual(orig, d.debug_flag) - self.assertTrue(mock_debug.called) + self.assertTrue(d.debug_log.called) def test_debug_log(self): d = self.get_obj() @@ -74,7 +74,6 @@ class TestPlugin(TestDebuggable): p = self.get_obj(core=core) self.assertEqual(p.data, os.path.join(datastore, p.name)) self.assertEqual(p.core, core) - self.assertIsInstance(p, Debuggable) @patch("os.makedirs") def test_init_repo(self, mock_makedirs): |