@@ -62,8 +62,8 @@ def setUp(self):
6262 self .app .client_manager .volume .quota_classes
6363 self .volume_quotas_class_mock .reset_mock ()
6464
65- self .app .client_manager .network . quotas = mock .Mock ()
66- self .network_quotas_mock = self .app .client_manager .network . quotas
65+ self .app .client_manager .network = mock .Mock ()
66+ self .network_mock = 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 ()
@@ -660,7 +660,6 @@ def setUp(self):
660660 loaded = True ,
661661 )
662662
663- self .network_mock = self .app .client_manager .network
664663 self .network_mock .update_quota = mock .Mock ()
665664
666665 self .cmd = quota .SetQuota (self .app , None )
@@ -1272,6 +1271,8 @@ class TestQuotaDelete(TestQuota):
12721271 def setUp (self ):
12731272 super ().setUp ()
12741273
1274+ self .network_mock .delete_quota = mock .Mock ()
1275+
12751276 self .cmd = quota .DeleteQuota (self .app , None )
12761277
12771278 def test_delete (self ):
@@ -1291,13 +1292,13 @@ def test_delete(self):
12911292 self .assertIsNone (result )
12921293 self .projects_mock .get .assert_called_once_with (self .projects [0 ].id )
12931294 self .compute_quotas_mock .delete .assert_called_once_with (
1294- self .projects [0 ],
1295+ self .projects [0 ]. id ,
12951296 )
12961297 self .volume_quotas_mock .delete .assert_called_once_with (
1297- self .projects [0 ],
1298+ self .projects [0 ]. id ,
12981299 )
1299- self .network_quotas_mock . delete .assert_called_once_with (
1300- self .projects [0 ],
1300+ self .network_mock . delete_quota .assert_called_once_with (
1301+ self .projects [0 ]. id ,
13011302 )
13021303
13031304 def test_delete__compute (self ):
@@ -1318,10 +1319,10 @@ def test_delete__compute(self):
13181319 self .assertIsNone (result )
13191320 self .projects_mock .get .assert_called_once_with (self .projects [0 ].id )
13201321 self .compute_quotas_mock .delete .assert_called_once_with (
1321- self .projects [0 ],
1322+ self .projects [0 ]. id ,
13221323 )
13231324 self .volume_quotas_mock .delete .assert_not_called ()
1324- self .network_quotas_mock . delete .assert_not_called ()
1325+ self .network_mock . delete_quota .assert_not_called ()
13251326
13261327 def test_delete__volume (self ):
13271328 """Delete volume quotas only"""
@@ -1342,9 +1343,9 @@ def test_delete__volume(self):
13421343 self .projects_mock .get .assert_called_once_with (self .projects [0 ].id )
13431344 self .compute_quotas_mock .delete .assert_not_called ()
13441345 self .volume_quotas_mock .delete .assert_called_once_with (
1345- self .projects [0 ],
1346+ self .projects [0 ]. id ,
13461347 )
1347- self .network_quotas_mock . delete .assert_not_called ()
1348+ self .network_mock . delete_quota .assert_not_called ()
13481349
13491350 def test_delete__network (self ):
13501351 """Delete network quotas only"""
@@ -1365,6 +1366,6 @@ def test_delete__network(self):
13651366 self .projects_mock .get .assert_called_once_with (self .projects [0 ].id )
13661367 self .compute_quotas_mock .delete .assert_not_called ()
13671368 self .volume_quotas_mock .delete .assert_not_called ()
1368- self .network_quotas_mock . delete .assert_called_once_with (
1369- self .projects [0 ],
1369+ self .network_mock . delete_quota .assert_called_once_with (
1370+ self .projects [0 ]. id ,
13701371 )
0 commit comments