diff options
| author | Zuul <zuul@review.openstack.org> | 2019-03-07 00:34:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-03-07 00:34:18 +0000 |
| commit | f992617f798426ff996eb776d8e16a03adef0bab (patch) | |
| tree | 3a064e8d85bde1a399b5a26a47babc4634174860 /openstackclient/tests/functional | |
| parent | 8159fc216db779e5f14db24d9224f01265f1c7b2 (diff) | |
| parent | 75cba9d1cbdd7b14b0d507af27f896c6c45e713e (diff) | |
| download | python-openstackclient-f992617f798426ff996eb776d8e16a03adef0bab.tar.gz | |
Merge "Add support for get details of Quota"
Diffstat (limited to 'openstackclient/tests/functional')
| -rw-r--r-- | openstackclient/tests/functional/common/test_quota.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/common/test_quota.py b/openstackclient/tests/functional/common/test_quota.py index 76c69a4d..85942281 100644 --- a/openstackclient/tests/functional/common/test_quota.py +++ b/openstackclient/tests/functional/common/test_quota.py @@ -31,6 +31,38 @@ class QuotaTests(base.TestCase): cls.PROJECT_NAME =\ cls.get_openstack_configuration_value('auth.project_name') + def test_quota_list_details_compute(self): + expected_headers = ["Resource", "In Use", "Reserved", "Limit"] + cmd_output = json.loads(self.openstack( + 'quota list -f json --detail --compute' + )) + self.assertIsNotNone(cmd_output) + resources = [] + for row in cmd_output: + row_headers = [str(r) for r in row.keys()] + self.assertEqual(sorted(expected_headers), sorted(row_headers)) + resources.append(row['Resource']) + # Ensure that returned quota is compute quota + self.assertIn("instances", resources) + # and that there is no network quota here + self.assertNotIn("networks", resources) + + def test_quota_list_details_network(self): + expected_headers = ["Resource", "In Use", "Reserved", "Limit"] + cmd_output = json.loads(self.openstack( + 'quota list -f json --detail --network' + )) + self.assertIsNotNone(cmd_output) + resources = [] + for row in cmd_output: + row_headers = [str(r) for r in row.keys()] + self.assertEqual(sorted(expected_headers), sorted(row_headers)) + resources.append(row['Resource']) + # Ensure that returned quota is network quota + self.assertIn("networks", resources) + # and that there is no compute quota here + self.assertNotIn("instances", resources) + def test_quota_list_network_option(self): if not self.haz_network: self.skipTest("No Network service present") |
