From 6d800dd8045c9f5fdae2ab15dfe53a931e6a3f5a Mon Sep 17 00:00:00 2001 From: Sushil Kumar Date: Sat, 21 Mar 2015 05:11:06 +0000 Subject: [PATCH] Fix the mocking in test_dbaas.py couchdb and coubase were mocking operating_system.get_ip_address, but they did not revert it back. Updated the test to unmocking done operating_system.get_ip_address Change-Id: I77fbd7bbfb1fdc8bcff57972e0200b970fd22b0d Closes-Bug: #1434767 --- trove/tests/unittests/guestagent/test_dbaas.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trove/tests/unittests/guestagent/test_dbaas.py b/trove/tests/unittests/guestagent/test_dbaas.py index 2f65c9f291..9b26b17e35 100644 --- a/trove/tests/unittests/guestagent/test_dbaas.py +++ b/trove/tests/unittests/guestagent/test_dbaas.py @@ -1691,6 +1691,7 @@ class CouchbaseAppTest(testtools.TestCase): self.orig_time_sleep = time.sleep time.sleep = Mock() self.orig_service_discovery = operating_system.service_discovery + self.orig_get_ip = operating_system.get_ip_address operating_system.service_discovery = ( self.fake_couchbase_service_discovery) operating_system.get_ip_address = Mock() @@ -1706,6 +1707,7 @@ class CouchbaseAppTest(testtools.TestCase): super(CouchbaseAppTest, self).tearDown() couchservice.utils.execute_with_timeout = ( self.orig_utils_execute_with_timeout) + operating_system.get_ip_address = self.orig_get_ip operating_system.service_discovery = self.orig_service_discovery time.sleep = self.orig_time_sleep InstanceServiceStatus.find_by(instance_id=self.FAKE_ID).delete() @@ -1792,6 +1794,7 @@ class CouchDBAppTest(testtools.TestCase): self.orig_time_sleep = time.sleep time.sleep = Mock() self.orig_service_discovery = operating_system.service_discovery + self.orig_get_ip = operating_system.get_ip_address operating_system.service_discovery = ( self.fake_couchdb_service_discovery) operating_system.get_ip_address = Mock() @@ -1808,6 +1811,7 @@ class CouchDBAppTest(testtools.TestCase): super(CouchDBAppTest, self).tearDown() couchdb_service.utils.execute_with_timeout = ( self.orig_utils_execute_with_timeout) + operating_system.get_ip_address = self.orig_get_ip operating_system.service_discovery = self.orig_service_discovery time.sleep = self.orig_time_sleep InstanceServiceStatus.find_by(instance_id=self.FAKE_ID).delete()