Example #1
0
    def testUsingTestData(self):
        """Test subject_confirmation_data_from_string() using test data"""

        scd = saml.subject_confirmation_data_from_string(saml2_data.TEST_SUBJECT_CONFIRMATION_DATA)
        assert scd.not_before == "2007-08-31T01:05:02Z"
        assert scd.not_on_or_after == "2007-09-14T01:05:02Z"
        assert scd.recipient == "recipient"
        assert scd.in_response_to == "responseID"
        assert scd.address == "127.0.0.1"
Example #2
0
    def testAccessors(self):
        """Test for SubjectConfirmationData accessors"""

        self.scd.not_before = "2007-08-31T01:05:02Z"
        self.scd.not_on_or_after = "2007-09-14T01:05:02Z"
        self.scd.recipient = "recipient"
        self.scd.in_response_to = "responseID"
        self.scd.address = "127.0.0.1"
        new_scd = saml.subject_confirmation_data_from_string(self.scd.to_string())
        assert new_scd.not_before == "2007-08-31T01:05:02Z"
        assert new_scd.not_on_or_after == "2007-09-14T01:05:02Z"
        assert new_scd.recipient == "recipient"
        assert new_scd.in_response_to == "responseID"
        assert new_scd.address == "127.0.0.1"
Example #3
0
 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"