Mock out service availability check in unit test
The unit test test_get_all_host_states_share(), testing host_manager's get_all_host_states_share() function makes an unnecessary call to the manila/utils.py function service_is_up(). This test fails sporadically due to initialization problems with the fake data provided. This patch mocks out the service availability check. The service availability check already had its own unit tests. TrivialFix Change-Id: I78090e86f5558d6b2192b0559445b7530380bcac
This commit is contained in:
parent
efdf04ead1
commit
f4858a8310
@ -147,6 +147,7 @@ class HostManagerTestCase(test.TestCase):
|
|||||||
self.mock_object(
|
self.mock_object(
|
||||||
db, 'service_get_all_by_topic',
|
db, 'service_get_all_by_topic',
|
||||||
mock.Mock(return_value=fakes.SHARE_SERVICES_WITH_POOLS))
|
mock.Mock(return_value=fakes.SHARE_SERVICES_WITH_POOLS))
|
||||||
|
self.mock_object(utils, 'service_is_up', mock.Mock(return_value=True))
|
||||||
|
|
||||||
with mock.patch.dict(self.host_manager.service_states,
|
with mock.patch.dict(self.host_manager.service_states,
|
||||||
fakes.SHARE_SERVICE_STATES_WITH_POOLS):
|
fakes.SHARE_SERVICE_STATES_WITH_POOLS):
|
||||||
|
Loading…
Reference in New Issue
Block a user