def testUsingTestData(self): """Test subject_confirmation_from_string() using test data""" sc = saml.subject_confirmation_from_string(saml2_data.TEST_SUBJECT_CONFIRMATION) assert sc.name_id.sp_provided_id == "sp provided id" assert sc.method == saml.SCM_BEARER assert sc.subject_confirmation_data.not_before == "2007-08-31T01:05:02Z" assert sc.subject_confirmation_data.not_on_or_after == "2007-09-14T01:05:02Z" assert sc.subject_confirmation_data.recipient == "recipient" assert sc.subject_confirmation_data.in_response_to == "responseID" assert sc.subject_confirmation_data.address == "127.0.0.1"
def testAccessors(self): """Test for Subject accessors""" self.subject.name_id = saml.name_id_from_string(saml2_data.TEST_NAME_ID) self.subject.subject_confirmation.append( saml.subject_confirmation_from_string(saml2_data.TEST_SUBJECT_CONFIRMATION) ) new_subject = saml.subject_from_string(self.subject.to_string()) assert new_subject.name_id.sp_provided_id == "sp provided id" assert new_subject.name_id.text.strip() == "*****@*****.**" assert new_subject.name_id.format == saml.NAMEID_FORMAT_EMAILADDRESS assert isinstance(new_subject.subject_confirmation[0], saml.SubjectConfirmation)
def testAccessors(self): """Test for SubjectConfirmation accessors""" self.sc.name_id = saml.name_id_from_string(saml2_data.TEST_NAME_ID) self.sc.method = saml.SCM_BEARER self.sc.subject_confirmation_data = saml.subject_confirmation_data_from_string( saml2_data.TEST_SUBJECT_CONFIRMATION_DATA ) new_sc = saml.subject_confirmation_from_string(self.sc.to_string()) assert new_sc.name_id.sp_provided_id == "sp provided id" assert new_sc.method == saml.SCM_BEARER assert new_sc.subject_confirmation_data.not_before == "2007-08-31T01:05:02Z" assert new_sc.subject_confirmation_data.not_on_or_after == "2007-09-14T01:05:02Z" assert new_sc.subject_confirmation_data.recipient == "recipient" assert new_sc.subject_confirmation_data.in_response_to == "responseID" assert new_sc.subject_confirmation_data.address == "127.0.0.1"