Un-monkeypatch utils module after test, otherwise it will spread over tests.

parent 332de509
...@@ -15,8 +15,8 @@ class FakeCallAndRead: ...@@ -15,8 +15,8 @@ class FakeCallAndRead:
self.external_command_list.extend(additional_buildout_parametr_list) self.external_command_list.extend(additional_buildout_parametr_list)
FakeCallAndRead = FakeCallAndRead() FakeCallAndRead = FakeCallAndRead()
#utils.bootstrapBuildout = FakeCallAndRead originalBootstrapBuildout = utils.bootstrapBuildout
#utils.launchBuildout = FakeCallAndRead originalLaunchBuildout = utils.launchBuildout
class TestSoftwareSlapObject(BasicMixin, unittest.TestCase): class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
""" """
...@@ -34,10 +34,20 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase): ...@@ -34,10 +34,20 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
self.shadir_cert_file = '/path/to/shadir/cert/file' self.shadir_cert_file = '/path/to/shadir/cert/file'
self.shadir_key_file = '/path/to/shadir/key/file' self.shadir_key_file = '/path/to/shadir/key/file'
# Monkey patch utils module
utils.bootstrapBuildout = FakeCallAndRead
utils.launchBuildout = FakeCallAndRead
def tearDown(self): def tearDown(self):
global originalBootstrapBuildout
global originalLaunchBuildout
BasicMixin.tearDown(self) BasicMixin.tearDown(self)
FakeCallAndRead.external_command_list = [] FakeCallAndRead.external_command_list = []
# Un-monkey patch utils module
utils.bootstrapBuildout = originalBootstrapBuildout
utils.launchBuildout = originalLaunchBuildout
# Test methods # Test methods
def test_software_install_with_networkcache(self): def test_software_install_with_networkcache(self):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment