diff options
| author | Sindhu Devale <sindhu.devale@intel.com> | 2016-09-29 15:32:51 -0500 |
|---|---|---|
| committer | Sindhu Devale <sindhu.devale@intel.com> | 2017-03-10 14:59:47 +0000 |
| commit | 58591d3c37c0265d8775f881271ba4d987e5ffb6 (patch) | |
| tree | 493ebc94d0f711e2dc1150a8ed28ba713c4612c2 /openstackclient/tests/unit/compute/v2 | |
| parent | 35c308ebadc23929f96eb74ab59091b7e691f09e (diff) | |
| download | python-openstackclient-58591d3c37c0265d8775f881271ba4d987e5ffb6.tar.gz | |
OSC Quota List
Implement Neutron feature of Quota List into
OpenStack Client.
Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57
Partially-Implements: blueprint neutron-client-quota
Diffstat (limited to 'openstackclient/tests/unit/compute/v2')
| -rw-r--r-- | openstackclient/tests/unit/compute/v2/fakes.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py index 4fe735b6..63b98a2a 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -1313,3 +1313,67 @@ class FakeUsage(object): usages.append(FakeUsage.create_one_usage(attrs)) return usages + + +class FakeQuota(object): + """Fake quota""" + + @staticmethod + def create_one_comp_quota(attrs=None): + """Create one quota""" + + attrs = attrs or {} + + quota_attrs = { + 'id': 'project-id-' + uuid.uuid4().hex, + 'cores': 20, + 'fixed_ips': 30, + 'injected_files': 100, + 'injected_file_content_bytes': 10240, + 'injected_file_path_bytes': 255, + 'instances': 50, + 'key_pairs': 20, + 'metadata_items': 10, + 'ram': 51200, + 'server_groups': 10, + 'server_group_members': 10 + } + + quota_attrs.update(attrs) + quota = fakes.FakeResource( + info=copy.deepcopy(quota_attrs), + loaded=True) + + quota.project_id = quota_attrs['id'] + + return quota + + @staticmethod + def create_one_default_comp_quota(attrs=None): + """Crate one quota""" + + attrs = attrs or {} + + quota_attrs = { + 'id': 'project-id-' + uuid.uuid4().hex, + 'cores': 10, + 'fixed_ips': 10, + 'injected_files': 100, + 'injected_file_content_bytes': 10240, + 'injected_file_path_bytes': 255, + 'instances': 20, + 'key_pairs': 20, + 'metadata_items': 10, + 'ram': 51200, + 'server_groups': 10, + 'server_group_members': 10 + } + + quota_attrs.update(attrs) + quota = fakes.FakeResource( + info=copy.deepcopy(quota_attrs), + loaded=True) + + quota.project_id = quota_attrs['id'] + + return quota |
