Skip to content

Commit 3bce02a

Browse files
skorandac00kiemon5ter
authored andcommitted
Add tests for SAML NameID formats
Add tests for new support for SAML NameID emailAddress and unspecified in response.
1 parent 570e08a commit 3bce02a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/satosa/frontends/test_saml2.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from saml2.entity_category.edugain import COCO
1515
from saml2.entity_category.refeds import RESEARCH_AND_SCHOLARSHIP
1616
from saml2.entity_category.swamid import SFS_1993_1153, RESEARCH_AND_EDUCATION, EU, HEI, NREN
17-
from saml2.saml import NAMEID_FORMAT_PERSISTENT, NAMEID_FORMAT_TRANSIENT
17+
from saml2.saml import NameID, NAMEID_FORMAT_TRANSIENT, \
18+
NAMEID_FORMAT_PERSISTENT, NAMEID_FORMAT_EMAILADDRESS, \
19+
NAMEID_FORMAT_UNSPECIFIED
1820
from saml2.samlp import NameIDPolicy
1921

2022
from satosa.attribute_mapping import AttributeMapper
@@ -365,3 +367,9 @@ def test_should_map_transient(self):
365367

366368
def test_should_map_persistent(self):
367369
assert saml_name_id_format_to_hash_type(NAMEID_FORMAT_PERSISTENT) == UserIdHashType.persistent
370+
371+
def test_should_map_email(self):
372+
assert saml_name_id_format_to_hash_type(NAMEID_FORMAT_EMAILADDRESS) == UserIdHashType.emailaddress
373+
374+
def test_should_map_unspecified(self):
375+
assert saml_name_id_format_to_hash_type(NAMEID_FORMAT_UNSPECIFIED) == UserIdHashType.unspecified

0 commit comments

Comments
 (0)