summaryrefslogtreecommitdiff
path: root/openstackclient/tests/identity/v3/fakes.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-08 22:17:56 +0000
committerGerrit Code Review <review@openstack.org>2014-10-08 22:17:56 +0000
commit35b0bbd7623df0ba47806f2bba446bd32c5c7791 (patch)
treee9213e3916e81baf4c3ba31d1ffb5d36e98726a5 /openstackclient/tests/identity/v3/fakes.py
parent0cb204e59b20f25b7a054b411507d6dabbc699ac (diff)
parent30b0a41ce70d39c5f650b6a2889b9e46a0930dd3 (diff)
downloadpython-openstackclient-35b0bbd7623df0ba47806f2bba446bd32c5c7791.tar.gz
Merge "Implement CRUD operations for Mapping objects"
Diffstat (limited to 'openstackclient/tests/identity/v3/fakes.py')
-rw-r--r--openstackclient/tests/identity/v3/fakes.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/identity/v3/fakes.py
index e9cda9ff..a88a905e 100644
--- a/openstackclient/tests/identity/v3/fakes.py
+++ b/openstackclient/tests/identity/v3/fakes.py
@@ -38,6 +38,65 @@ GROUP = {
'name': group_name,
}
+mapping_id = 'test_mapping'
+mapping_rules_file_path = '/tmp/path/to/file'
+# Copied from
+# (https://github.com/openstack/keystone/blob\
+# master/keystone/tests/mapping_fixtures.py
+EMPLOYEE_GROUP_ID = "0cd5e9"
+DEVELOPER_GROUP_ID = "xyz"
+MAPPING_RULES = [
+ {
+ "local": [
+ {
+ "group": {
+ "id": EMPLOYEE_GROUP_ID
+ }
+ }
+ ],
+ "remote": [
+ {
+ "type": "orgPersonType",
+ "not_any_of": [
+ "Contractor",
+ "Guest"
+ ]
+ }
+ ]
+ }
+]
+
+MAPPING_RULES_2 = [
+ {
+ "local": [
+ {
+ "group": {
+ "id": DEVELOPER_GROUP_ID
+ }
+ }
+ ],
+ "remote": [
+ {
+ "type": "orgPersonType",
+ "any_one_of": [
+ "Contractor"
+ ]
+ }
+ ]
+ }
+]
+
+
+MAPPING_RESPONSE = {
+ "id": mapping_id,
+ "rules": MAPPING_RULES
+}
+
+MAPPING_RESPONSE_2 = {
+ "id": mapping_id,
+ "rules": MAPPING_RULES_2
+}
+
project_id = '8-9-64'
project_name = 'beatles'
project_description = 'Fab Four'
@@ -224,6 +283,8 @@ class FakeFederationManager(object):
def __init__(self, **kwargs):
self.identity_providers = mock.Mock()
self.identity_providers.resource_class = fakes.FakeResource(None, {})
+ self.mappings = mock.Mock()
+ self.mappings.resource_class = fakes.FakeResource(None, {})
class FakeFederatedClient(FakeIdentityv3Client):