@@ -48,11 +48,10 @@ def setUp(self):
4848 self .projects_mock .reset_mock ()
4949 self .projects_mock .get .return_value = self .projects [0 ]
5050
51- self .compute_quotas_mock = self .app .client_manager .compute .quotas
51+ self .compute_client = self .app .client_manager .compute
52+ self .compute_quotas_mock = self .compute_client .quotas
5253 self .compute_quotas_mock .reset_mock ()
53- self .compute_quotas_class_mock = (
54- self .app .client_manager .compute .quota_classes
55- )
54+ self .compute_quotas_class_mock = self .compute_client .quota_classes
5655 self .compute_quotas_class_mock .reset_mock ()
5756
5857 self .volume_quotas_mock = self .volume_client .quotas
@@ -125,8 +124,7 @@ def setUp(self):
125124 compute_fakes .create_one_default_comp_quota (),
126125 compute_fakes .create_one_default_comp_quota (),
127126 ]
128- self .compute = self .app .client_manager .compute
129- self .compute .quotas .defaults = mock .Mock (
127+ self .compute_client .quotas .defaults = mock .Mock (
130128 side_effect = self .compute_default_quotas ,
131129 )
132130
@@ -221,7 +219,7 @@ def test_quota_list_details_compute(self):
221219 detailed_quota
222220 )
223221
224- self .compute .quotas .get = mock .Mock (return_value = detailed_quota )
222+ self .compute_client .quotas .get = mock .Mock (return_value = detailed_quota )
225223
226224 arglist = [
227225 '--detail' ,
@@ -305,7 +303,7 @@ def test_quota_list_details_volume(self):
305303
306304 def test_quota_list_compute (self ):
307305 # Two projects with non-default quotas
308- self .compute .quotas .get = mock .Mock (
306+ self .compute_client .quotas .get = mock .Mock (
309307 side_effect = self .compute_quotas ,
310308 )
311309
@@ -326,7 +324,7 @@ def test_quota_list_compute(self):
326324
327325 def test_quota_list_compute_default (self ):
328326 # One of the projects is at defaults
329- self .compute .quotas .get = mock .Mock (
327+ self .compute_client .quotas .get = mock .Mock (
330328 side_effect = [
331329 self .compute_quotas [0 ],
332330 compute_fakes .create_one_default_comp_quota (),
@@ -350,7 +348,7 @@ def test_quota_list_compute_default(self):
350348
351349 def test_quota_list_compute_no_project_not_found (self ):
352350 # Make one of the projects disappear
353- self .compute .quotas .get = mock .Mock (
351+ self .compute_client .quotas .get = mock .Mock (
354352 side_effect = [
355353 self .compute_quotas [0 ],
356354 exceptions .NotFound ("NotFound" ),
@@ -374,7 +372,7 @@ def test_quota_list_compute_no_project_not_found(self):
374372
375373 def test_quota_list_compute_no_project_4xx (self ):
376374 # Make one of the projects disappear
377- self .compute .quotas .get = mock .Mock (
375+ self .compute_client .quotas .get = mock .Mock (
378376 side_effect = [
379377 self .compute_quotas [0 ],
380378 exceptions .BadRequest ("Bad request" ),
@@ -398,7 +396,7 @@ def test_quota_list_compute_no_project_4xx(self):
398396
399397 def test_quota_list_compute_no_project_5xx (self ):
400398 # Make one of the projects disappear
401- self .compute .quotas .get = mock .Mock (
399+ self .compute_client .quotas .get = mock .Mock (
402400 side_effect = [
403401 self .compute_quotas [0 ],
404402 exceptions .HTTPNotImplemented ("Not implemented??" ),
@@ -421,7 +419,7 @@ def test_quota_list_compute_no_project_5xx(self):
421419
422420 def test_quota_list_compute_by_project (self ):
423421 # Two projects with non-default quotas
424- self .compute .quotas .get = mock .Mock (
422+ self .compute_client .quotas .get = mock .Mock (
425423 side_effect = self .compute_quotas ,
426424 )
427425
0 commit comments