From 75dd86ddeff6f275699ce4f26661431f8579e2d7 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 13 Jun 2013 15:25:02 -0400 Subject: testsuite: fixed tests for a03fde3ea32d3eb2cadb443454749111dda1797f --- .../Testlib/TestServer/TestPlugin/Testbase.py | 37 +++++++++++----------- 1 file 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..5fc850b2b 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 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): -- cgit v1.2.3-1-g7c22