diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-04-21 11:33:24 -0500 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-04-21 11:33:24 -0500 |
| commit | 27024d70af4756cb6e4b210b025ed7427541f773 (patch) | |
| tree | 9917c28a6a973272866d68337165a0886bbb219f /openstackclient/tests | |
| parent | 0d3a06db1ce3871e4153255d21c9c9f6ac321030 (diff) | |
| download | python-openstackclient-27024d70af4756cb6e4b210b025ed7427541f773.tar.gz | |
Support quota show for current project
The "os quota show" command "<project/class>" argument is now
optional. If not specified, the user's current project is used.
This allows non-admin users to show quotas for their current
project.
Change-Id: I602d4cc09c9d29ce84271eff78137f8810cb1a47
Closes-Bug: #1572733
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/common/test_quota.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openstackclient/tests/common/test_quota.py b/openstackclient/tests/common/test_quota.py index edf29c9b..ba7ee469 100644 --- a/openstackclient/tests/common/test_quota.py +++ b/openstackclient/tests/common/test_quota.py @@ -59,6 +59,7 @@ class TestQuota(compute_fakes.TestComputev2): self.service_catalog_mock = \ self.app.client_manager.auth_ref.service_catalog self.service_catalog_mock.reset_mock() + self.app.client_manager.auth_ref.project_id = identity_fakes.project_id class TestQuotaSet(TestQuota): @@ -304,3 +305,13 @@ class TestQuotaShow(TestQuota): identity_fakes.project_id) self.volume_quotas_class_mock.get.assert_called_with( identity_fakes.project_id) + + def test_quota_show_no_project(self): + parsed_args = self.check_parser(self.cmd, [], []) + + self.cmd.take_action(parsed_args) + + self.quotas_mock.get.assert_called_with(identity_fakes.project_id) + self.volume_quotas_mock.get.assert_called_with( + identity_fakes.project_id) + self.network.get_quota.assert_called_with(identity_fakes.project_id) |
