Skip to content

Commit 9d0cc9c

Browse files
author
Ioannis Kakavas
committed
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)
1 parent 63d3165 commit 9d0cc9c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_20_assertion.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ def test_filter_on_attributes_1():
8181
assert ava["serialNumber"] == ["12345"]
8282

8383

84+
def test_filter_on_attributes_2():
85+
86+
a = to_dict(Attribute(friendly_name="surName",name="urn:oid:2.5.4.4",
87+
name_format=NAME_FORMAT_URI), ONTS)
88+
required = [a]
89+
ava = {"sn":["kakavas"]}
90+
91+
ava = filter_on_attributes(ava,required,acs=ac_factory())
92+
assert list(ava.keys()) == ['sn']
93+
assert ava["sn"] == ["kakavas"]
94+
95+
8496
def test_filter_on_attributes_without_friendly_name():
8597
ava = {"eduPersonTargetedID": "[email protected]",
8698
"eduPersonAffiliation": "test",
@@ -923,3 +935,4 @@ def test_assertion_with_authn_instant():
923935

924936
if __name__ == "__main__":
925937
test_assertion_2()
938+

0 commit comments

Comments
 (0)