summaryrefslogtreecommitdiffstats
path: root/tests/identity_auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/identity_auth.py')
-rw-r--r--tests/identity_auth.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/identity_auth.py b/tests/identity_auth.py
index 4726ca37..0031caec 100644
--- a/tests/identity_auth.py
+++ b/tests/identity_auth.py
@@ -11,6 +11,7 @@ import os
from keystoneauth1.identity import v2
from keystoneauth1.identity import v3
+from keystoneauth1 import session
def get_identity_auth():
@@ -32,3 +33,10 @@ def get_identity_auth():
username=username,
password=password,
tenant_name=project_name)
+
+
+def get_session(auth=None):
+ """Get a user credentials auth session."""
+ if auth is None:
+ auth = get_identity_auth()
+ return session.Session(auth=auth)