Add missing mock for cinder.default_quota_get
When running tests, I get the following logs: INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): public.nova.example.com DEBUG:cinderclient.client:Connection refused: HTTPConnectionPool(host='public.nova.example.com', port=8776): Max retries exceeded with url: /v1/os-quota-sets/1/defaults (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known) Which signify, that there is a mock missing in the tests. This patch adds that missing mock. Change-Id: I4f79f533b729112d11c7165adde2ac751d49f46b Closes-Bug: #1300141
This commit is contained in:
parent
f4282f73ec
commit
e019ed140e
|
@ -29,7 +29,8 @@ class SystemInfoViewTests(test.BaseAdminViewTests):
|
|||
|
||||
@test.create_stubs({api.base: ('is_service_enabled',),
|
||||
api.nova: ('default_quota_get', 'service_list'),
|
||||
api.neutron: ('agent_list', 'is_extension_supported')})
|
||||
api.neutron: ('agent_list', 'is_extension_supported'),
|
||||
api.cinder: ('default_quota_get',)})
|
||||
def test_index(self):
|
||||
services = self.services.list()
|
||||
api.nova.service_list(IsA(http.HttpRequest)).AndReturn(services)
|
||||
|
@ -40,6 +41,8 @@ class SystemInfoViewTests(test.BaseAdminViewTests):
|
|||
.MultipleTimes().AndReturn(True)
|
||||
api.nova.default_quota_get(IsA(http.HttpRequest),
|
||||
IgnoreArg()).AndReturn({})
|
||||
api.cinder.default_quota_get(IsA(http.HttpRequest), self.tenant.id)\
|
||||
.AndReturn(self.cinder_quotas.first())
|
||||
api.neutron.is_extension_supported(IsA(http.HttpRequest),
|
||||
'security-group').AndReturn(True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue