Make it possible to use PluginLoader without store
[cascardo/ipsilon.git] / tests / testmapping.py
index 1bc69ec..6daa636 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/python
-# Copyright (C) 2015 Ipsilon Project Contributors
+#
+# Copyright (C) 2015 Ipsilon project Contributors, for license see COPYING
 
 from helpers.common import IpsilonTestBase  # pylint: disable=relative-import
 from helpers.http import HttpSessions  # pylint: disable=relative-import
@@ -15,6 +16,7 @@ from string import Template
 idp_g = {'TEMPLATES': '${TESTDIR}/templates/install',
          'CONFDIR': '${TESTDIR}/etc',
          'DATADIR': '${TESTDIR}/lib',
+         'CACHEDIR': '${TESTDIR}/cache',
          'HTTPDCONFD': '${TESTDIR}/${NAME}/conf.d',
          'STATICDIR': '${ROOTDIR}',
          'BINDIR': '${ROOTDIR}/ipsilon',
@@ -28,7 +30,7 @@ idp_a = {'hostname': '${ADDRESS}:${PORT}',
          'secure': 'no',
          'testauth': 'yes',
          'pam': 'no',
-         'krb': 'no',
+         'gssapi': 'no',
          'ipa': 'no',
          'server_debugging': 'True'}
 
@@ -65,7 +67,7 @@ def check_info_plugin(s, idp_name, urlbase, expected):
     """
     Logout, login, fetch SP page to get the info variables and
     compare the MELLON_ ones to what we expect.  IDP and NAMEID are
-    ignored. The authtest plugin returns no groups.
+    ignored.
     """
 
     # Log out
@@ -84,7 +86,7 @@ def check_info_plugin(s, idp_name, urlbase, expected):
     data.pop('MELLON_IDP')
     data.pop('MELLON_NAME_ID')
 
-    for key in expected.keys():
+    for key in expected:
         item = data.pop('MELLON_' + key)
         if item != expected[key]:
             raise ValueError('Expected %s, got %s' % (expected[key], item))
@@ -195,6 +197,7 @@ if __name__ == '__main__':
             'surname': user,
             'givenname': 'Test User',
             'email': '%s@example.com' % user,
+            'groups': user,
         }
         check_info_plugin(sess, idpname, spurl, expect)
     except Exception, e:  # pylint: disable=broad-except
@@ -221,6 +224,7 @@ if __name__ == '__main__':
             'surname': user,
             'givenname': 'Test User',
             'email': '%s@example.com' % user,
+            'groups': user
         }
         check_info_plugin(sess, idpname, spurl, expect)
     except Exception, e:  # pylint: disable=broad-except