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/volume | |
| 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/volume')
| -rw-r--r-- | openstackclient/tests/unit/volume/v2/fakes.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/volume/v2/fakes.py b/openstackclient/tests/unit/volume/v2/fakes.py index d54faec7..d321c71a 100644 --- a/openstackclient/tests/unit/volume/v2/fakes.py +++ b/openstackclient/tests/unit/volume/v2/fakes.py @@ -954,3 +954,53 @@ class FakeType(object): info=copy.deepcopy(encryption_info), loaded=True) return encryption_type + + +class FakeQuota(object): + """Fake quota""" + + @staticmethod + def create_one_vol_quota(attrs=None): + """Create one quota""" + attrs = attrs or {} + + quota_attrs = { + 'id': 'project-id-' + uuid.uuid4().hex, + 'backups': 100, + 'backup_gigabytes': 100, + 'gigabytes': 10, + 'per_volume_gigabytes': 10, + 'snapshots': 0, + 'volumes': 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_vol_quota(attrs=None): + """Create one quota""" + attrs = attrs or {} + + quota_attrs = { + 'id': 'project-id-' + uuid.uuid4().hex, + 'backups': 100, + 'backup_gigabytes': 100, + 'gigabytes': 100, + 'per_volume_gigabytes': 100, + 'snapshots': 100, + 'volumes': 100} + + quota_attrs.update(attrs) + + quota = fakes.FakeResource( + info=copy.deepcopy(quota_attrs), + loaded=True) + quota.project_id = quota_attrs['id'] + + return quota |
