Skip to content

Commit e0fb5e3

Browse files
author
Roland Hedberg
committed
Verify that the Schac OID are correct.
1 parent 95c12d0 commit e0fb5e3

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

tests/test_19_attribute_converter.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pathutils import full_path
88
from saml2.attribute_converter import AttributeConverterNOOP
99
from saml2.attribute_converter import to_local
10+
from saml2.saml import attribute_from_string
1011

1112

1213
def _eq(l1,l2):
@@ -205,8 +206,22 @@ def test_noop_attribute_conversion():
205206
assert attr.attribute_value[0].text == "Roland"
206207

207208

209+
ava = """<?xml version='1.0' encoding='UTF-8'?>
210+
<ns0:Attribute xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" FriendlyName="schacHomeOrganization" Name="urn:oid:1.3.6.1.4.1.25178.1.2.9" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"><ns0:AttributeValue xsi:nil="true" xsi:type="xs:string">uu.se</ns0:AttributeValue></ns0:Attribute>"""
211+
212+
213+
def test_schac():
214+
attr = attribute_from_string(ava)
215+
acs = attribute_converter.ac_factory()
216+
for ac in acs:
217+
try:
218+
res = ac.ava_from(attr)
219+
except KeyError:
220+
pass
221+
222+
208223
if __name__ == "__main__":
209-
t = TestAC()
210-
t.setup_class()
211-
t.test_mixed_attributes_1()
212-
#test_noop_attribute_conversion()
224+
# t = TestAC()
225+
# t.setup_class()
226+
# t.test_mixed_attributes_1()
227+
test_schac()

0 commit comments

Comments
 (0)