diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-03-21 03:56:05 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-03-21 03:56:05 +0000 |
| commit | 6329c04297f7f08159eb1e9a0e3c089e188397af (patch) | |
| tree | 42fbddf3f11d91bceea43de5a66f249d95acdfc8 /openstackclient/tests/unit/compute | |
| parent | efc570dae223a46de4a77d0ed03648998ca37eab (diff) | |
| parent | 58591d3c37c0265d8775f881271ba4d987e5ffb6 (diff) | |
| download | python-openstackclient-6329c04297f7f08159eb1e9a0e3c089e188397af.tar.gz | |
Merge "OSC Quota List"
Diffstat (limited to 'openstackclient/tests/unit/compute')
| -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 bbb770bb..4a194859 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -1357,3 +1357,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 |
