Merge "Fix the mocking in test_dbaas.py"

This commit is contained in:
Jenkins
2015-03-24 20:08:06 +00:00
committed by Gerrit Code Review

View File

@@ -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()