diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-07-21 22:07:50 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-07-21 22:07:50 +0000 |
| commit | 3e1d54299f74773b35ab5ff8eb144c99b7e9114d (patch) | |
| tree | 08cc48ee2756a048be875b99644798298fc081f5 /openstackclient/tests/volume/v2/fakes.py | |
| parent | ba34c592a717ce8d4f1d813838e7a7bb3528d09d (diff) | |
| parent | 5e8957ef7f4acea1ece06378c050021b64ea3f6f (diff) | |
| download | python-openstackclient-3e1d54299f74773b35ab5ff8eb144c99b7e9114d.tar.gz | |
Merge "Show project access for volume type"
Diffstat (limited to 'openstackclient/tests/volume/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/volume/v2/fakes.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/openstackclient/tests/volume/v2/fakes.py b/openstackclient/tests/volume/v2/fakes.py index 74e30a41..6809bebd 100644 --- a/openstackclient/tests/volume/v2/fakes.py +++ b/openstackclient/tests/volume/v2/fakes.py @@ -76,6 +76,38 @@ class FakeTransfer(object): return transfer +class FakeTypeAccess(object): + """Fake one or more volume type access.""" + + @staticmethod + def create_one_type_access(attrs=None): + """Create a fake volume type access for project. + + :param Dictionary attrs: + A dictionary with all attributes + :return: + A FakeResource object, with Volume_type_ID and Project_ID. + """ + if attrs is None: + attrs = {} + + # Set default attributes. + type_access_attrs = { + 'volume_type_id': 'volume-type-id-' + uuid.uuid4().hex, + 'project_id': 'project-id-' + uuid.uuid4().hex, + } + + # Overwrite default attributes. + type_access_attrs.update(attrs) + + type_access = fakes.FakeResource( + None, + type_access_attrs, + loaded=True) + + return type_access + + class FakeServiceClient(object): def __init__(self, **kwargs): @@ -666,6 +698,7 @@ class FakeType(object): "name": 'type-name-' + uuid.uuid4().hex, "description": 'type-description-' + uuid.uuid4().hex, "extra_specs": {"foo": "bar"}, + "is_public": True, } # Overwrite default attributes. |
