summaryrefslogtreecommitdiff
path: root/openstackclient/tests/image/v2/fakes.py
diff options
context:
space:
mode:
authorchengkunye <chengkun@unitedstack.com>2015-07-16 17:32:42 +0800
committerSteve Martinelli <stevemar@ca.ibm.com>2015-07-20 10:38:42 -0700
commit7bb459837bf8023cbc71cbf41007f8aa4c4725fb (patch)
treedbd44e8ff55d7889fd8988a7613a2a061f2a5d47 /openstackclient/tests/image/v2/fakes.py
parent1af89f757c1edf44067de964cb6ca8dffbb1969e (diff)
downloadpython-openstackclient-7bb459837bf8023cbc71cbf41007f8aa4c4725fb.tar.gz
add image member commands for image API
This commit adds the following commands: image project add image project remove Closes-Bug: 1402420 Change-Id: I07954e9fa43a3ad6078dd939ecedf9f038299e7b
Diffstat (limited to 'openstackclient/tests/image/v2/fakes.py')
-rw-r--r--openstackclient/tests/image/v2/fakes.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/openstackclient/tests/image/v2/fakes.py b/openstackclient/tests/image/v2/fakes.py
index 678291bb..1a9e301a 100644
--- a/openstackclient/tests/image/v2/fakes.py
+++ b/openstackclient/tests/image/v2/fakes.py
@@ -18,6 +18,7 @@ import mock
from openstackclient.tests import fakes
from openstackclient.tests import utils
+from openstackclient.tests.identity.v3 import fakes as identity_fakes
image_id = '0f41529e-7c12-4de8-be2d-181abb825b3c'
image_name = 'graven'
@@ -36,6 +37,13 @@ IMAGE = {
IMAGE_columns = tuple(sorted(IMAGE))
IMAGE_data = tuple((IMAGE[x] for x in sorted(IMAGE)))
+member_status = 'pending'
+MEMBER = {
+ 'member_id': identity_fakes.project_id,
+ 'image_id': image_id,
+ 'status': member_status,
+}
+
# Just enough v2 schema to do some testing
IMAGE_schema = {
"additionalProperties": {
@@ -125,6 +133,8 @@ class FakeImagev2Client(object):
def __init__(self, **kwargs):
self.images = mock.Mock()
self.images.resource_class = fakes.FakeResource(None, {})
+ self.image_members = mock.Mock()
+ self.image_members.resource_class = fakes.FakeResource(None, {})
self.auth_token = kwargs['token']
self.management_url = kwargs['endpoint']
@@ -137,3 +147,8 @@ class TestImagev2(utils.TestCommand):
endpoint=fakes.AUTH_URL,
token=fakes.AUTH_TOKEN,
)
+
+ self.app.client_manager.identity = identity_fakes.FakeIdentityv3Client(
+ endpoint=fakes.AUTH_URL,
+ token=fakes.AUTH_TOKEN,
+ )