|
13 | 13 | import copy |
14 | 14 | import mock |
15 | 15 |
|
16 | | -from openstack.network.v2 import quota as _quota |
17 | | - |
18 | 16 | from openstackclient.common import quota |
19 | 17 | from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes |
20 | 18 | from openstackclient.tests.unit import fakes |
@@ -284,32 +282,27 @@ def test_quota_set_network(self): |
284 | 282 | ] |
285 | 283 | parsed_args = self.check_parser(self.cmd, arglist, verifylist) |
286 | 284 |
|
287 | | - # TODO(huanxuan): Remove this if condition once the fixed |
288 | | - # SDK Quota class is the minimum required version. |
289 | | - # This is expected to be SDK release 0.9.13 |
290 | | - if not hasattr(_quota.Quota, 'allow_get'): |
291 | | - # Just run this when sdk <= 0.9.10 |
292 | | - result = self.cmd.take_action(parsed_args) |
293 | | - kwargs = { |
294 | | - 'subnet': network_fakes.QUOTA['subnet'], |
295 | | - 'network': network_fakes.QUOTA['network'], |
296 | | - 'floatingip': network_fakes.QUOTA['floatingip'], |
297 | | - 'subnetpool': network_fakes.QUOTA['subnetpool'], |
298 | | - 'security_group_rule': |
299 | | - network_fakes.QUOTA['security_group_rule'], |
300 | | - 'security_group': network_fakes.QUOTA['security_group'], |
301 | | - 'router': network_fakes.QUOTA['router'], |
302 | | - 'rbac_policy': network_fakes.QUOTA['rbac_policy'], |
303 | | - 'port': network_fakes.QUOTA['port'], |
304 | | - 'vip': network_fakes.QUOTA['vip'], |
305 | | - 'healthmonitor': network_fakes.QUOTA['healthmonitor'], |
306 | | - 'l7policy': network_fakes.QUOTA['l7policy'], |
307 | | - } |
308 | | - self.network_mock.update_quota.assert_called_once_with( |
309 | | - identity_fakes.project_id, |
310 | | - **kwargs |
311 | | - ) |
312 | | - self.assertIsNone(result) |
| 285 | + result = self.cmd.take_action(parsed_args) |
| 286 | + kwargs = { |
| 287 | + 'subnet': network_fakes.QUOTA['subnet'], |
| 288 | + 'network': network_fakes.QUOTA['network'], |
| 289 | + 'floatingip': network_fakes.QUOTA['floatingip'], |
| 290 | + 'subnetpool': network_fakes.QUOTA['subnetpool'], |
| 291 | + 'security_group_rule': |
| 292 | + network_fakes.QUOTA['security_group_rule'], |
| 293 | + 'security_group': network_fakes.QUOTA['security_group'], |
| 294 | + 'router': network_fakes.QUOTA['router'], |
| 295 | + 'rbac_policy': network_fakes.QUOTA['rbac_policy'], |
| 296 | + 'port': network_fakes.QUOTA['port'], |
| 297 | + 'vip': network_fakes.QUOTA['vip'], |
| 298 | + 'healthmonitor': network_fakes.QUOTA['healthmonitor'], |
| 299 | + 'l7policy': network_fakes.QUOTA['l7policy'], |
| 300 | + } |
| 301 | + self.network_mock.update_quota.assert_called_once_with( |
| 302 | + identity_fakes.project_id, |
| 303 | + **kwargs |
| 304 | + ) |
| 305 | + self.assertIsNone(result) |
313 | 306 |
|
314 | 307 | def test_quota_set_with_class(self): |
315 | 308 | arglist = [ |
@@ -483,20 +476,15 @@ def test_quota_show_with_default(self): |
483 | 476 |
|
484 | 477 | parsed_args = self.check_parser(self.cmd, arglist, verifylist) |
485 | 478 |
|
486 | | - # TODO(huanxuan): Remove this if condition once the fixed |
487 | | - # SDK QuotaDefault class is the minimum required version. |
488 | | - # This is expected to be SDK release 0.9.13 |
489 | | - if not hasattr(_quota.QuotaDefault, 'project'): |
490 | | - # Just run this when sdk <= 0.9.10 |
491 | | - self.cmd.take_action(parsed_args) |
492 | | - |
493 | | - self.quotas_mock.defaults.assert_called_once_with( |
494 | | - identity_fakes.project_id) |
495 | | - self.volume_quotas_mock.defaults.assert_called_once_with( |
496 | | - identity_fakes.project_id) |
497 | | - self.network.get_quota_default.assert_called_once_with( |
498 | | - identity_fakes.project_id) |
499 | | - self.assertNotCalled(self.network.get_quota) |
| 479 | + self.cmd.take_action(parsed_args) |
| 480 | + |
| 481 | + self.quotas_mock.defaults.assert_called_once_with( |
| 482 | + identity_fakes.project_id) |
| 483 | + self.volume_quotas_mock.defaults.assert_called_once_with( |
| 484 | + identity_fakes.project_id) |
| 485 | + self.network.get_quota_default.assert_called_once_with( |
| 486 | + identity_fakes.project_id) |
| 487 | + self.assertNotCalled(self.network.get_quota) |
500 | 488 |
|
501 | 489 | def test_quota_show_with_class(self): |
502 | 490 | arglist = [ |
|
0 commit comments