diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-06-27 08:19:09 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-06-27 08:19:09 -0400 |
commit | 317d3087459538877100032733477362f456f550 (patch) | |
tree | 27fabdff3649c75bcdd9de8ccde5c5826c679e5e /testsuite/Testsrc/Testlib/TestServer/TestPlugin | |
parent | 9d5e8170292e17d3b087878918562dcf502f70d4 (diff) | |
parent | a519dc9298317b678bca43597892df5aa13d874d (diff) | |
download | bcfg2-317d3087459538877100032733477362f456f550.tar.gz bcfg2-317d3087459538877100032733477362f456f550.tar.bz2 bcfg2-317d3087459538877100032733477362f456f550.zip |
Merge branch 'maint'
Conflicts:
doc/server/plugins/generators/cfg.txt
doc/server/plugins/generators/tcheetah.txt
src/lib/Bcfg2/Server/Admin/Xcmd.py
src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugin')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py index 318f5ceaa..e26c26d41 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py @@ -80,24 +80,25 @@ class TestPlugin(TestDebuggable): @patch("os.makedirs") @patch("os.path.exists") def test__init(self, mock_exists, mock_makedirs): - core = Mock() - core.setup = MagicMock() - - mock_exists.return_value = True - p = self.get_obj(core=core) - self.assertEqual(p.data, os.path.join(datastore, p.name)) - self.assertEqual(p.core, core) - mock_exists.assert_any_call(p.data) - self.assertFalse(mock_makedirs.called) - - mock_exists.reset_mock() - mock_makedirs.reset_mock() - mock_exists.return_value = False - p = self.get_obj(core=core) - self.assertEqual(p.data, os.path.join(datastore, p.name)) - self.assertEqual(p.core, core) - mock_exists.assert_any_call(p.data) - mock_makedirs.assert_any_call(p.data) + if self.test_obj.create: + core = Mock() + core.setup = MagicMock() + + mock_exists.return_value = True + p = self.get_obj(core=core) + self.assertEqual(p.data, os.path.join(datastore, p.name)) + self.assertEqual(p.core, core) + mock_exists.assert_any_call(p.data) + self.assertFalse(mock_makedirs.called) + + mock_exists.reset_mock() + mock_makedirs.reset_mock() + mock_exists.return_value = False + p = self.get_obj(core=core) + self.assertEqual(p.data, os.path.join(datastore, p.name)) + self.assertEqual(p.core, core) + mock_exists.assert_any_call(p.data) + mock_makedirs.assert_any_call(p.data) @patch("os.makedirs") def test_init_repo(self, mock_makedirs): |