Commit 285e04f4 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos.package.test: Restore original method after the test

parent 67b7dff5
...@@ -48,7 +48,9 @@ def _fake_signature_download(self, path, *args, **kwargs): ...@@ -48,7 +48,9 @@ def _fake_signature_download(self, path, *args, **kwargs):
class testBasePromiseCase(unittest.TestCase): class testBasePromiseCase(unittest.TestCase):
def setUp(self): def setUp(self):
self.original_basepromise_call = BasePromise._call
BasePromise._call = _fake_call BasePromise._call = _fake_call
self.original_network_cache_download = NetworkCache.download
NetworkCache.download = _fake_signature_download NetworkCache.download = _fake_signature_download
global FAKE_CALL_COUNTER global FAKE_CALL_COUNTER
FAKE_CALL_COUNTER = 0 FAKE_CALL_COUNTER = 0
...@@ -60,6 +62,10 @@ class testBasePromiseCase(unittest.TestCase): ...@@ -60,6 +62,10 @@ class testBasePromiseCase(unittest.TestCase):
"verbose": False "verbose": False
} }
def tearDown(self):
BasePromise._call = self.original_basepromise_call
NetworkCache.download = self.original_network_cache_download
def _createConfigurationFile(self): def _createConfigurationFile(self):
with open("/tmp/test_base_promise_configuration.cfg", "w") as configuration_file: with open("/tmp/test_base_promise_configuration.cfg", "w") as configuration_file:
......
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