File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11from pathutils import full_path as expand_full_path
2+
23from pytest import mark
34from pytest import raises
45
6+ from saml2 import create_class_from_xml_string
7+ from saml2 .saml import AttributeStatement
8+ from saml2 .sigver import validate_doc_with_schema
59from saml2 .xml .schema import XMLSchemaError
610from saml2 .xml .schema import validate as validate_doc_with_schema
711
@@ -86,3 +90,20 @@ def test_valid_saml_partial_doc(doc):
8690def test_valid_eidas_saml_response_doc (doc ):
8791 result = validate_doc_with_schema (expand_full_path (doc ))
8892 assert result == None
93+
94+
95+ def test_namespace_processing ():
96+ elem = create_class_from_xml_string (
97+ AttributeStatement ,
98+ """
99+ <saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
100+ <saml:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
101+ <saml:AttributeValue xsi:type="xs:string">alum11</saml:AttributeValue>
102+ </saml:Attribute>
103+ <saml:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
104+ <saml:AttributeValue xsi:type="xs:string"/>
105+ </saml:Attribute>
106+ </saml:AttributeStatement>
107+ """ ,
108+ )
109+ validate_doc_with_schema (str (elem ))
You can’t perform that action at this time.
0 commit comments