diff options
| author | Zuul <zuul@review.opendev.org> | 2022-11-05 09:09:16 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-11-05 09:09:16 +0000 |
| commit | 1e37c12b16ce08faca7aaa0cc4385d55066fc7cc (patch) | |
| tree | f05c3d0144f1f8fd0fdbc82df5f3d91598d087ce /openstackclient/tests/unit | |
| parent | a03b2352d941cf283f5519c1dc46929550ce373a (diff) | |
| parent | 00e7019022585bc2be9aeb55eb40b1d04776ec22 (diff) | |
| download | python-openstackclient-1e37c12b16ce08faca7aaa0cc4385d55066fc7cc.tar.gz | |
Merge "quota: Allow showing project-specific quotas"
Diffstat (limited to 'openstackclient/tests/unit')
| -rw-r--r-- | openstackclient/tests/unit/common/test_quota.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/common/test_quota.py b/openstackclient/tests/unit/common/test_quota.py index 53aab5f2..0900200e 100644 --- a/openstackclient/tests/unit/common/test_quota.py +++ b/openstackclient/tests/unit/common/test_quota.py @@ -1087,6 +1087,7 @@ class TestQuotaShow(TestQuota): self.projects[0].name, ] verifylist = [ + ('service', 'all'), ('project', self.projects[0].name), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -1107,6 +1108,67 @@ class TestQuotaShow(TestQuota): ) self.assertNotCalled(self.network.get_quota_default) + def test_quota_show__with_compute(self): + arglist = [ + '--compute', + self.projects[0].name, + ] + verifylist = [ + ('service', 'compute'), + ('project', self.projects[0].name), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + self.compute_quotas_mock.get.assert_called_once_with( + self.projects[0].id, + detail=False, + ) + self.volume_quotas_mock.get.assert_not_called() + self.network.get_quota.assert_not_called() + + def test_quota_show__with_volume(self): + arglist = [ + '--volume', + self.projects[0].name, + ] + verifylist = [ + ('service', 'volume'), + ('project', self.projects[0].name), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + self.compute_quotas_mock.get.assert_not_called() + self.volume_quotas_mock.get.assert_called_once_with( + self.projects[0].id, + usage=False, + ) + self.network.get_quota.assert_not_called() + + def test_quota_show__with_network(self): + arglist = [ + '--network', + self.projects[0].name, + ] + verifylist = [ + ('service', 'network'), + ('project', self.projects[0].name), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + self.compute_quotas_mock.get.assert_not_called() + self.volume_quotas_mock.get.assert_not_called() + self.network.get_quota.assert_called_once_with( + self.projects[0].id, + details=False, + ) + self.assertNotCalled(self.network.get_quota_default) + def test_quota_show__with_default(self): arglist = [ '--default', |
