summaryrefslogtreecommitdiff
path: root/tests/test_37_entity_categories.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-05 21:02:30 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-05 21:02:30 +0200
commit4951a6089c9095a561d144994f530dae544cfed3 (patch)
tree32223f5fa346ebf81ca54cdd6cd83f6d6432904d /tests/test_37_entity_categories.py
parentc96237ce9f4ac51451c6cebdab9a9aa524bd607a (diff)
downloadpysaml2-4951a6089c9095a561d144994f530dae544cfed3.tar.gz
Added support for entity categories - some fixes.
Diffstat (limited to 'tests/test_37_entity_categories.py')
-rw-r--r--tests/test_37_entity_categories.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_37_entity_categories.py b/tests/test_37_entity_categories.py
index 739725eb..09c03249 100644
--- a/tests/test_37_entity_categories.py
+++ b/tests/test_37_entity_categories.py
@@ -10,6 +10,7 @@ from saml2.extension import mdattr
from saml2.extension import ui
from pathutils import full_path
from saml2.mdstore import MetadataStore
+from saml2.server import Server
import xmldsig
import xmlenc
@@ -101,5 +102,19 @@ def test_filter_ava3():
assert _eq(ava.keys(), ['eduPersonTargetedID', "norEduPersonNIN"])
+def test_idp_policy_filter():
+ idp = Server("idp_conf_ec")
+
+ ava = {"givenName": ["Derek"], "surname": ["Jeter"],
+ "email": ["derek@nyy.mlb.com"], "c": ["USA"],
+ "eduPersonTargetedID": "foo!bar!xyz",
+ "norEduPersonNIN": "19800101134"}
+
+ policy = idp.config.getattr("policy", "idp")
+ policy.filter(ava, "urn:mace:example.com:saml:roland:sp", idp.metadata)
+
+ print ava
+ assert ava.keys() == ["eduPersonTargetedID"] # because no entity category
+
if __name__ == "__main__":
- test_filter_ava2() \ No newline at end of file
+ test_idp_policy_filter() \ No newline at end of file