Skip to content

Commit

Permalink
Add test for encrypted attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Oct 9, 2023
1 parent 59db3ca commit 28b753e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/src/OneLogin/saml2_tests/response_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,23 @@ def testGetFriendlyAttributes(self):
response_6 = OneLogin_Saml2_Response(settings, xml_5)
self.assertEqual(expected_attributes, response_6.get_friendlyname_attributes())

def testGetEncryptedAttributes(self):
"""
Tests the get_attributes method of the OneLogin_Saml2_Response with an encrypted response
"""
settings = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings8.json'))
xml = self.file_contents(join(self.data_path, 'responses',
'signed_message_encrypted_assertion2.xml.base64'))
response = OneLogin_Saml2_Response(settings, xml)
self.assertEqual({
'uid': ['smartin'],
'mail': ['smartin@yaco.es'],
'cn': ['Sixto3'],
'sn': ['Martin2'],
'phone': [],
'eduPersonAffiliation': ['user', 'admin'],
}, response.get_attributes())

def testGetNestedNameIDAttributes(self):
"""
Tests the getAttributes method of the OneLogin_Saml2_Response with nested
Expand Down

0 comments on commit 28b753e

Please sign in to comment.