summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoannis Kakavas <ikakavas@noc.grnet.gr>2017-06-12 14:58:09 +0300
committerIoannis Kakavas <ikakavas@noc.grnet.gr>2017-06-12 16:56:00 +0300
commit9d0cc9cdb6c692ff97dc7a6e890aa7b1445f7af1 (patch)
tree1cdb36cad4baff6500755cf7661f154d1b5e7cd5
parent63d316554075740906282eee5967dc7149e3fd6f (diff)
downloadpysaml2-9d0cc9cdb6c692ff97dc7a6e890aa7b1445f7af1.tar.gz
Add failing test for filtering attributes
Added a test that fails when the friendlyName of the requested attribute is not the same with the name of the internal attribute (even though the OIDs and the internal representation names of the attribute are the same)
-rw-r--r--tests/test_20_assertion.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_20_assertion.py b/tests/test_20_assertion.py
index ae661d53..b53c9960 100644
--- a/tests/test_20_assertion.py
+++ b/tests/test_20_assertion.py
@@ -81,6 +81,18 @@ def test_filter_on_attributes_1():
assert ava["serialNumber"] == ["12345"]
+def test_filter_on_attributes_2():
+
+ a = to_dict(Attribute(friendly_name="surName",name="urn:oid:2.5.4.4",
+ name_format=NAME_FORMAT_URI), ONTS)
+ required = [a]
+ ava = {"sn":["kakavas"]}
+
+ ava = filter_on_attributes(ava,required,acs=ac_factory())
+ assert list(ava.keys()) == ['sn']
+ assert ava["sn"] == ["kakavas"]
+
+
def test_filter_on_attributes_without_friendly_name():
ava = {"eduPersonTargetedID": "test@example.com",
"eduPersonAffiliation": "test",
@@ -923,3 +935,4 @@ def test_assertion_with_authn_instant():
if __name__ == "__main__":
test_assertion_2()
+