summaryrefslogtreecommitdiff
path: root/openstackclient/tests/identity/v3/fakes.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/identity/v3/fakes.py')
-rw-r--r--openstackclient/tests/identity/v3/fakes.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/identity/v3/fakes.py
index f2696ef8..ffa89a5f 100644
--- a/openstackclient/tests/identity/v3/fakes.py
+++ b/openstackclient/tests/identity/v3/fakes.py
@@ -105,6 +105,15 @@ TOKEN_WITH_DOMAIN_ID = {
'user_id': user_id,
}
+idp_id = 'test_idp'
+idp_description = 'super exciting IdP description'
+
+IDENTITY_PROVIDER = {
+ 'id': idp_id,
+ 'enabled': True,
+ 'description': idp_description
+}
+
class FakeIdentityv3Client(object):
def __init__(self, **kwargs):
@@ -125,6 +134,14 @@ class FakeIdentityv3Client(object):
self.management_url = kwargs['endpoint']
+class FakeFederatedClient(FakeIdentityv3Client):
+ def __init__(self, **kwargs):
+ super(FakeFederatedClient, self).__init__(**kwargs)
+
+ self.identity_providers = mock.Mock()
+ self.identity_providers.resource_class = fakes.FakeResource(None, {})
+
+
class TestIdentityv3(utils.TestCommand):
def setUp(self):
super(TestIdentityv3, self).setUp()
@@ -133,3 +150,13 @@ class TestIdentityv3(utils.TestCommand):
endpoint=fakes.AUTH_URL,
token=fakes.AUTH_TOKEN,
)
+
+
+class TestFederatedIdentity(utils.TestCommand):
+ def setUp(self):
+ super(TestFederatedIdentity, self).setUp()
+
+ self.app.client_manager.identity = FakeFederatedClient(
+ endpoint=fakes.AUTH_URL,
+ token=fakes.AUTH_TOKEN
+ )