@@ -63,7 +63,7 @@ def setUp(self):
6363 self .volume_quotas_class_mock .reset_mock ()
6464
6565 self .app .client_manager .network = mock .Mock ()
66- self .network_mock = self .app .client_manager .network
66+ self .network_client = self .app .client_manager .network
6767
6868 self .app .client_manager .auth_ref = mock .Mock ()
6969 self .app .client_manager .auth_ref .service_catalog = mock .Mock ()
@@ -158,8 +158,7 @@ def setUp(self):
158158 network_fakes .FakeQuota .create_one_default_net_quota (),
159159 network_fakes .FakeQuota .create_one_default_net_quota (),
160160 ]
161- self .network = self .app .client_manager .network
162- self .network .get_quota_default = mock .Mock (
161+ self .network_client .get_quota_default = mock .Mock (
163162 side_effect = self .network_default_quotas ,
164163 )
165164
@@ -261,7 +260,7 @@ def test_quota_list_details_network(self):
261260 detailed_quota
262261 )
263262
264- self .network .get_quota = mock .Mock (return_value = detailed_quota )
263+ self .network_client .get_quota = mock .Mock (return_value = detailed_quota )
265264
266265 arglist = [
267266 '--detail' ,
@@ -452,7 +451,7 @@ def test_quota_list_compute_by_project(self):
452451
453452 def test_quota_list_network (self ):
454453 # Two projects with non-default quotas
455- self .network .get_quota = mock .Mock (
454+ self .network_client .get_quota = mock .Mock (
456455 side_effect = self .network_quotas ,
457456 )
458457
@@ -473,7 +472,7 @@ def test_quota_list_network(self):
473472
474473 def test_quota_list_network_default (self ):
475474 # Two projects with non-default quotas
476- self .network .get_quota = mock .Mock (
475+ self .network_client .get_quota = mock .Mock (
477476 side_effect = [
478477 self .network_quotas [0 ],
479478 network_fakes .FakeQuota .create_one_default_net_quota (),
@@ -497,7 +496,7 @@ def test_quota_list_network_default(self):
497496
498497 def test_quota_list_network_no_project (self ):
499498 # Two projects with non-default quotas
500- self .network .get_quota = mock .Mock (
499+ self .network_client .get_quota = mock .Mock (
501500 side_effect = [
502501 self .network_quotas [0 ],
503502 exceptions .NotFound ("NotFound" ),
@@ -521,7 +520,7 @@ def test_quota_list_network_no_project(self):
521520
522521 def test_quota_list_network_by_project (self ):
523522 # Two projects with non-default quotas
524- self .network .get_quota = mock .Mock (
523+ self .network_client .get_quota = mock .Mock (
525524 side_effect = self .network_quotas ,
526525 )
527526
@@ -663,7 +662,7 @@ def setUp(self):
663662 loaded = True ,
664663 )
665664
666- self .network_mock .update_quota = mock .Mock ()
665+ self .network_client .update_quota = mock .Mock ()
667666
668667 self .cmd = quota .SetQuota (self .app , None )
669668
@@ -893,7 +892,7 @@ def test_quota_set_network(self):
893892 'rbac_policy' : network_fakes .QUOTA ['rbac_policy' ],
894893 'port' : network_fakes .QUOTA ['port' ],
895894 }
896- self .network_mock .update_quota .assert_called_once_with (
895+ self .network_client .update_quota .assert_called_once_with (
897896 self .projects [0 ].id , ** kwargs
898897 )
899898 self .assertIsNone (result )
@@ -980,7 +979,7 @@ def test_quota_set_with_class(self):
980979 self .volume_quotas_class_mock .update .assert_called_with (
981980 self .projects [0 ].name , ** kwargs_volume
982981 )
983- self .assertNotCalled (self .network_mock .update_quota )
982+ self .assertNotCalled (self .network_client .update_quota )
984983 self .assertIsNone (result )
985984
986985 def test_quota_set_with_force (self ):
@@ -1031,7 +1030,7 @@ def test_quota_set_with_force(self):
10311030 self .volume_quotas_mock .update .assert_called_once_with (
10321031 self .projects [0 ].id , ** kwargs_volume
10331032 )
1034- self .network_mock .update_quota .assert_called_once_with (
1033+ self .network_client .update_quota .assert_called_once_with (
10351034 self .projects [0 ].id , ** kwargs_network
10361035 )
10371036 self .assertIsNone (result )
@@ -1075,7 +1074,7 @@ def test_quota_set_with_no_force(self):
10751074 self .volume_quotas_mock .update .assert_called_once_with (
10761075 self .projects [0 ].id , ** kwargs_volume
10771076 )
1078- self .network_mock .update_quota .assert_called_once_with (
1077+ self .network_client .update_quota .assert_called_once_with (
10791078 self .projects [0 ].id , ** kwargs_network
10801079 )
10811080 self .assertIsNone (result )
@@ -1121,12 +1120,10 @@ def setUp(self):
11211120 'network' : fake_network_endpoint
11221121 }
11231122
1124- self .app .client_manager .network = mock .Mock ()
1125- self .network = self .app .client_manager .network
1126- self .network .get_quota = mock .Mock (
1123+ self .network_client .get_quota = mock .Mock (
11271124 return_value = network_fakes .QUOTA ,
11281125 )
1129- self .network .get_quota_default = mock .Mock (
1126+ self .network_client .get_quota_default = mock .Mock (
11301127 return_value = network_fakes .QUOTA ,
11311128 )
11321129
@@ -1152,11 +1149,11 @@ def test_quota_show(self):
11521149 self .projects [0 ].id ,
11531150 usage = False ,
11541151 )
1155- self .network .get_quota .assert_called_once_with (
1152+ self .network_client .get_quota .assert_called_once_with (
11561153 self .projects [0 ].id ,
11571154 details = False ,
11581155 )
1159- self .assertNotCalled (self .network .get_quota_default )
1156+ self .assertNotCalled (self .network_client .get_quota_default )
11601157
11611158 def test_quota_show__with_compute (self ):
11621159 arglist = [
@@ -1176,7 +1173,7 @@ def test_quota_show__with_compute(self):
11761173 detail = False ,
11771174 )
11781175 self .volume_quotas_mock .get .assert_not_called ()
1179- self .network .get_quota .assert_not_called ()
1176+ self .network_client .get_quota .assert_not_called ()
11801177
11811178 def test_quota_show__with_volume (self ):
11821179 arglist = [
@@ -1196,7 +1193,7 @@ def test_quota_show__with_volume(self):
11961193 self .projects [0 ].id ,
11971194 usage = False ,
11981195 )
1199- self .network .get_quota .assert_not_called ()
1196+ self .network_client .get_quota .assert_not_called ()
12001197
12011198 def test_quota_show__with_network (self ):
12021199 arglist = [
@@ -1213,11 +1210,11 @@ def test_quota_show__with_network(self):
12131210
12141211 self .compute_quotas_mock .get .assert_not_called ()
12151212 self .volume_quotas_mock .get .assert_not_called ()
1216- self .network .get_quota .assert_called_once_with (
1213+ self .network_client .get_quota .assert_called_once_with (
12171214 self .projects [0 ].id ,
12181215 details = False ,
12191216 )
1220- self .assertNotCalled (self .network .get_quota_default )
1217+ self .assertNotCalled (self .network_client .get_quota_default )
12211218
12221219 def test_quota_show__with_default (self ):
12231220 arglist = [
@@ -1238,10 +1235,10 @@ def test_quota_show__with_default(self):
12381235 self .volume_quotas_mock .defaults .assert_called_once_with (
12391236 self .projects [0 ].id ,
12401237 )
1241- self .network .get_quota_default .assert_called_once_with (
1238+ self .network_client .get_quota_default .assert_called_once_with (
12421239 self .projects [0 ].id ,
12431240 )
1244- self .assertNotCalled (self .network .get_quota )
1241+ self .assertNotCalled (self .network_client .get_quota )
12451242
12461243 def test_quota_show__with_class (self ):
12471244 arglist = [
@@ -1259,16 +1256,16 @@ def test_quota_show__with_class(self):
12591256 self .compute_quotas_class_mock .get .assert_called_once_with ('default' )
12601257 self .volume_quotas_class_mock .get .assert_called_once_with ('default' )
12611258 # neutron doesn't have the concept of quota classes
1262- self .assertNotCalled (self .network .get_quota )
1263- self .assertNotCalled (self .network .get_quota_default )
1259+ self .assertNotCalled (self .network_client .get_quota )
1260+ self .assertNotCalled (self .network_client .get_quota_default )
12641261
12651262 def test_quota_show__with_usage (self ):
12661263 # update mocks to return detailed quota instead
12671264 self .compute_quota = compute_fakes .create_one_comp_detailed_quota ()
12681265 self .compute_quotas_mock .get .return_value = self .compute_quota
12691266 self .volume_quota = volume_fakes .create_one_detailed_quota ()
12701267 self .volume_quotas_mock .get .return_value = self .volume_quota
1271- self .network .get_quota .return_value = (
1268+ self .network_client .get_quota .return_value = (
12721269 network_fakes .FakeQuota .create_one_net_detailed_quota ()
12731270 )
12741271
@@ -1292,7 +1289,7 @@ def test_quota_show__with_usage(self):
12921289 self .projects [0 ].id ,
12931290 usage = True ,
12941291 )
1295- self .network .get_quota .assert_called_once_with (
1292+ self .network_client .get_quota .assert_called_once_with (
12961293 self .projects [0 ].id ,
12971294 details = True ,
12981295 )
@@ -1312,10 +1309,10 @@ def test_quota_show__no_project(self):
13121309 self .volume_quotas_mock .get .assert_called_once_with (
13131310 identity_fakes .project_id , usage = False
13141311 )
1315- self .network .get_quota .assert_called_once_with (
1312+ self .network_client .get_quota .assert_called_once_with (
13161313 identity_fakes .project_id , details = False
13171314 )
1318- self .assertNotCalled (self .network .get_quota_default )
1315+ self .assertNotCalled (self .network_client .get_quota_default )
13191316
13201317
13211318class TestQuotaDelete (TestQuota ):
@@ -1324,7 +1321,7 @@ class TestQuotaDelete(TestQuota):
13241321 def setUp (self ):
13251322 super ().setUp ()
13261323
1327- self .network_mock .delete_quota = mock .Mock ()
1324+ self .network_client .delete_quota = mock .Mock ()
13281325
13291326 self .cmd = quota .DeleteQuota (self .app , None )
13301327
@@ -1350,7 +1347,7 @@ def test_delete(self):
13501347 self .volume_quotas_mock .delete .assert_called_once_with (
13511348 self .projects [0 ].id ,
13521349 )
1353- self .network_mock .delete_quota .assert_called_once_with (
1350+ self .network_client .delete_quota .assert_called_once_with (
13541351 self .projects [0 ].id ,
13551352 )
13561353
@@ -1375,7 +1372,7 @@ def test_delete__compute(self):
13751372 self .projects [0 ].id ,
13761373 )
13771374 self .volume_quotas_mock .delete .assert_not_called ()
1378- self .network_mock .delete_quota .assert_not_called ()
1375+ self .network_client .delete_quota .assert_not_called ()
13791376
13801377 def test_delete__volume (self ):
13811378 """Delete volume quotas only"""
@@ -1398,7 +1395,7 @@ def test_delete__volume(self):
13981395 self .volume_quotas_mock .delete .assert_called_once_with (
13991396 self .projects [0 ].id ,
14001397 )
1401- self .network_mock .delete_quota .assert_not_called ()
1398+ self .network_client .delete_quota .assert_not_called ()
14021399
14031400 def test_delete__network (self ):
14041401 """Delete network quotas only"""
@@ -1419,6 +1416,6 @@ def test_delete__network(self):
14191416 self .projects_mock .get .assert_called_once_with (self .projects [0 ].id )
14201417 self .compute_quotas_mock .delete .assert_not_called ()
14211418 self .volume_quotas_mock .delete .assert_not_called ()
1422- self .network_mock .delete_quota .assert_called_once_with (
1419+ self .network_client .delete_quota .assert_called_once_with (
14231420 self .projects [0 ].id ,
14241421 )
0 commit comments