@@ -214,13 +214,15 @@ def setUp(self):
214214 loaded = True ,
215215 )
216216
217- self .service_catalog_mock .get_endpoints .return_value = [
218- fakes .FakeResource (
219- None ,
220- copy .deepcopy (identity_fakes .ENDPOINT ),
221- loaded = True ,
222- )
223- ]
217+ fake_network_endpoint = fakes .FakeResource (
218+ None ,
219+ copy .deepcopy (identity_fakes .ENDPOINT ),
220+ loaded = True ,
221+ )
222+
223+ self .service_catalog_mock .get_endpoints .return_value = {
224+ 'network' : fake_network_endpoint
225+ }
224226
225227 self .quotas_class_mock .get .return_value = FakeQuotaResource (
226228 None ,
@@ -244,6 +246,8 @@ def setUp(self):
244246 endpoint = fakes .AUTH_URL ,
245247 token = fakes .AUTH_TOKEN ,
246248 )
249+ self .network = self .app .client_manager .network
250+ self .network .get_quota = mock .Mock (return_value = network_fakes .QUOTA )
247251
248252 self .cmd = quota .ShowQuota (self .app , None )
249253
@@ -260,6 +264,9 @@ def test_quota_show(self):
260264 self .cmd .take_action (parsed_args )
261265
262266 self .quotas_mock .get .assert_called_with (identity_fakes .project_id )
267+ self .volume_quotas_mock .get .assert_called_with (
268+ identity_fakes .project_id )
269+ self .network .get_quota .assert_called_with (identity_fakes .project_id )
263270
264271 def test_quota_show_with_default (self ):
265272 arglist = [
@@ -276,6 +283,8 @@ def test_quota_show_with_default(self):
276283 self .cmd .take_action (parsed_args )
277284
278285 self .quotas_mock .defaults .assert_called_with (identity_fakes .project_id )
286+ self .volume_quotas_mock .defaults .assert_called_with (
287+ identity_fakes .project_id )
279288
280289 def test_quota_show_with_class (self ):
281290 arglist = [
@@ -293,3 +302,5 @@ def test_quota_show_with_class(self):
293302
294303 self .quotas_class_mock .get .assert_called_with (
295304 identity_fakes .project_id )
305+ self .volume_quotas_class_mock .get .assert_called_with (
306+ identity_fakes .project_id )
0 commit comments