diff --git a/tests/test_md.py b/tests/test_md.py index e67ab81..a7691b9 100644 --- a/tests/test_md.py +++ b/tests/test_md.py @@ -377,7 +377,7 @@ class TestRoleDescriptor: def testAccessors(self): """Test for RoleDescriptor accessors""" - self.role_descriptor.id = "ID" + self.role_descriptor.identifier = "ID" self.role_descriptor.valid_until = "2008-09-14T01:05:02Z" self.role_descriptor.cache_duration = "10:00:00:00" self.role_descriptor.protocol_support_enumeration = samlp.SAMLP_NAMESPACE @@ -391,7 +391,7 @@ class TestRoleDescriptor: new_role_descriptor = md.role_descriptor_from_string( self.role_descriptor.to_string()) - assert new_role_descriptor.id == "ID" + assert new_role_descriptor.identifier == "ID" assert new_role_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_role_descriptor.cache_duration == "10:00:00:00" assert new_role_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -408,7 +408,7 @@ class TestRoleDescriptor: """Test for role_descriptor_from_string() using test data.""" new_role_descriptor = md.role_descriptor_from_string( md_data.TEST_ROLE_DESCRIPTOR) - assert new_role_descriptor.id == "ID" + assert new_role_descriptor.identifier == "ID" assert new_role_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_role_descriptor.cache_duration == "10:00:00:00" assert new_role_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -427,7 +427,7 @@ class TestSSODescriptor: def testAccessors(self): """Test for SSODescriptor accessors""" - self.sso_descriptor.id = "ID" + self.sso_descriptor.identifier = "ID" self.sso_descriptor.valid_until = "2008-09-14T01:05:02Z" self.sso_descriptor.cache_duration = "10:00:00:00" self.sso_descriptor.protocol_support_enumeration = samlp.SAMLP_NAMESPACE @@ -449,7 +449,7 @@ class TestSSODescriptor: new_sso_descriptor = md.sso_descriptor_from_string( self.sso_descriptor.to_string()) - assert new_sso_descriptor.id == "ID" + assert new_sso_descriptor.identifier == "ID" assert new_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_sso_descriptor.cache_duration == "10:00:00:00" assert new_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -474,7 +474,7 @@ class TestSSODescriptor: """Test for sso_descriptor_from_string() using test data.""" new_sso_descriptor = md.sso_descriptor_from_string( md_data.TEST_SSO_DESCRIPTOR) - assert new_sso_descriptor.id == "ID" + assert new_sso_descriptor.identifier == "ID" assert new_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_sso_descriptor.cache_duration == "10:00:00:00" assert new_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -688,7 +688,7 @@ class TestIDPSSODescriptor: def testAccessors(self): """Test for IDPSSODescriptor accessors""" - self.idp_sso_descriptor.id = "ID" + self.idp_sso_descriptor.identifier = "ID" self.idp_sso_descriptor.valid_until = "2008-09-14T01:05:02Z" self.idp_sso_descriptor.cache_duration = "10:00:00:00" self.idp_sso_descriptor.protocol_support_enumeration = \ @@ -721,7 +721,7 @@ class TestIDPSSODescriptor: new_idp_sso_descriptor = md.idpsso_descriptor_from_string( self.idp_sso_descriptor.to_string()) - assert new_idp_sso_descriptor.id == "ID" + assert new_idp_sso_descriptor.identifier == "ID" assert new_idp_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_idp_sso_descriptor.cache_duration == "10:00:00:00" assert new_idp_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -760,7 +760,7 @@ class TestIDPSSODescriptor: """Test for idpsso_descriptor_from_string() using test data.""" new_idp_sso_descriptor = md.idpsso_descriptor_from_string( md_data.TEST_IDP_SSO_DESCRIPTOR) - assert new_idp_sso_descriptor.id == "ID" + assert new_idp_sso_descriptor.identifier == "ID" assert new_idp_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_idp_sso_descriptor.cache_duration == "10:00:00:00" assert new_idp_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -944,7 +944,7 @@ class TestSPSSODescriptor: def testAccessors(self): """Test for SPSSODescriptor accessors""" - self.sp_sso_descriptor.id = "ID" + self.sp_sso_descriptor.identifier = "ID" self.sp_sso_descriptor.valid_until = "2008-09-14T01:05:02Z" self.sp_sso_descriptor.cache_duration = "10:00:00:00" self.sp_sso_descriptor.protocol_support_enumeration = \ @@ -973,7 +973,7 @@ class TestSPSSODescriptor: new_sp_sso_descriptor = md.spsso_descriptor_from_string( self.sp_sso_descriptor.to_string()) - assert new_sp_sso_descriptor.id == "ID" + assert new_sp_sso_descriptor.identifier == "ID" assert new_sp_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_sp_sso_descriptor.cache_duration == "10:00:00:00" assert new_sp_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -1008,7 +1008,7 @@ class TestSPSSODescriptor: """Test for spsso_descriptor_from_string() using test data.""" new_sp_sso_descriptor = md.spsso_descriptor_from_string( md_data.TEST_SP_SSO_DESCRIPTOR) - assert new_sp_sso_descriptor.id == "ID" + assert new_sp_sso_descriptor.identifier == "ID" assert new_sp_sso_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_sp_sso_descriptor.cache_duration == "10:00:00:00" assert new_sp_sso_descriptor.protocol_support_enumeration == samlp.SAMLP_NAMESPACE @@ -1046,7 +1046,7 @@ class TestEntityDescriptor: def testAccessors(self): """Test for RoleDescriptor accessors""" - self.entity_descriptor.id = "ID" + self.entity_descriptor.identifier = "ID" self.entity_descriptor.entity_id = "entityID" self.entity_descriptor.valid_until = "2008-09-14T01:05:02Z" self.entity_descriptor.cache_duration = "10:00:00:00" @@ -1063,7 +1063,7 @@ class TestEntityDescriptor: new_entity_descriptor = md.entity_descriptor_from_string( self.entity_descriptor.to_string()) - assert new_entity_descriptor.id == "ID" + assert new_entity_descriptor.identifier == "ID" assert new_entity_descriptor.entity_id == "entityID" assert new_entity_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_entity_descriptor.cache_duration == "10:00:00:00" @@ -1087,7 +1087,7 @@ class TestEntityDescriptor: """Test for entity_descriptor_from_string() using test data.""" new_entity_descriptor = md.entity_descriptor_from_string( md_data.TEST_ENTITY_DESCRIPTOR) - assert new_entity_descriptor.id == "ID" + assert new_entity_descriptor.identifier == "ID" assert new_entity_descriptor.entity_id == "entityID" assert new_entity_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_entity_descriptor.cache_duration == "10:00:00:00" @@ -1113,7 +1113,7 @@ class TestEntitiesDescriptor: def testAccessors(self): """Test for EntitiesDescriptor accessors""" - self.entities_descriptor.id = "ID" + self.entities_descriptor.identifier = "ID" self.entities_descriptor.name = "name" self.entities_descriptor.valid_until = "2008-09-14T01:05:02Z" self.entities_descriptor.cache_duration = "10:00:00:00" @@ -1126,7 +1126,7 @@ class TestEntitiesDescriptor: new_entities_descriptor = md.entities_descriptor_from_string( self.entities_descriptor.to_string()) - assert new_entities_descriptor.id == "ID" + assert new_entities_descriptor.identifier == "ID" assert new_entities_descriptor.name == "name" assert new_entities_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_entities_descriptor.cache_duration == "10:00:00:00" @@ -1141,7 +1141,7 @@ class TestEntitiesDescriptor: """Test for entities_descriptor_from_string() using test data.""" new_entities_descriptor = md.entities_descriptor_from_string( md_data.TEST_ENTITIES_DESCRIPTOR) - assert new_entities_descriptor.id == "ID" + assert new_entities_descriptor.identifier == "ID" assert new_entities_descriptor.name == "name" assert new_entities_descriptor.valid_until == "2008-09-14T01:05:02Z" assert new_entities_descriptor.cache_duration == "10:00:00:00" diff --git a/tests/test_saml.py b/tests/test_saml.py index 0355adc..897461c 100644 --- a/tests/test_saml.py +++ b/tests/test_saml.py @@ -847,8 +847,8 @@ class TestAssertion: def testAccessors(self): """Test for Assertion accessors""" - self.assertion.id = "assertion id" - self.assertion.version = saml.V2 + self.assertion.identifier = "assertion id" + self.assertion.version = saml2.VERSION self.assertion.issue_instant = "2007-08-31T01:05:02Z" self.assertion.issuer = saml.issuer_from_string(saml2_data.TEST_ISSUER) self.assertion.signature = ds.signature_from_string( @@ -867,8 +867,8 @@ class TestAssertion: saml2_data.TEST_ATTRIBUTE_STATEMENT)) new_assertion = saml.assertion_from_string(self.assertion.to_string()) - assert new_assertion.id == "assertion id" - assert new_assertion.version == saml.V2 + assert new_assertion.identifier == "assertion id" + assert new_assertion.version == saml2.VERSION assert new_assertion.issue_instant == "2007-08-31T01:05:02Z" assert isinstance(new_assertion.issuer, saml.Issuer) assert isinstance(new_assertion.signature, ds.Signature) diff --git a/tests/test_samlp.py b/tests/test_samlp.py index a8258f4..8e739d6 100644 --- a/tests/test_samlp.py +++ b/tests/test_samlp.py @@ -38,7 +38,7 @@ class TestAbstractRequest: def testAccessors(self): """Test for AbstractRequest accessors""" self.ar.id = "request id" - self.ar.version = saml.V2 + self.ar.version = saml2.VERSION self.ar.issue_instant = "2007-09-14T01:05:02Z" self.ar.destination = "http://www.example.com/Destination" self.ar.consent = saml.CONSENT_UNSPECIFIED @@ -48,7 +48,7 @@ class TestAbstractRequest: new_ar = samlp.abstract_request_from_string(self.ar.to_string()) assert new_ar.id == "request id" - assert new_ar.version == saml.V2 + assert new_ar.version == saml2.VERSION assert new_ar.issue_instant == "2007-09-14T01:05:02Z" assert new_ar.destination == "http://www.example.com/Destination" assert new_ar.consent == saml.CONSENT_UNSPECIFIED @@ -141,7 +141,7 @@ class TestStatusResponse: """Test for StatusResponse accessors""" self.sr.id = "response id" self.sr.in_response_to = "request id" - self.sr.version = saml.V2 + self.sr.version = saml2.VERSION self.sr.issue_instant = "2007-09-14T01:05:02Z" self.sr.destination = "http://www.example.com/Destination" self.sr.consent = saml.CONSENT_UNSPECIFIED @@ -153,7 +153,7 @@ class TestStatusResponse: new_sr = samlp.status_response_from_string(self.sr.to_string()) assert new_sr.id == "response id" assert new_sr.in_response_to == "request id" - assert new_sr.version == saml.V2 + assert new_sr.version == saml2.VERSION assert new_sr.issue_instant == "2007-09-14T01:05:02Z" assert new_sr.destination == "http://www.example.com/Destination" assert new_sr.consent == saml.CONSENT_UNSPECIFIED @@ -177,7 +177,7 @@ class TestResponse: """Test for Response accessors""" self.response.id = "response id" self.response.in_response_to = "request id" - self.response.version = saml.V2 + self.response.version = saml2.VERSION self.response.issue_instant = "2007-09-14T01:05:02Z" self.response.destination = "http://www.example.com/Destination" self.response.consent = saml.CONSENT_UNSPECIFIED @@ -191,7 +191,7 @@ class TestResponse: new_response = samlp.response_from_string(self.response.to_string()) assert new_response.id == "response id" assert new_response.in_response_to == "request id" - assert new_response.version == saml.V2 + assert new_response.version == saml2.VERSION assert new_response.issue_instant == "2007-09-14T01:05:02Z" assert new_response.destination == "http://www.example.com/Destination" assert new_response.consent == saml.CONSENT_UNSPECIFIED @@ -355,7 +355,7 @@ class TestAuthnRequest: def testAccessors(self): """Test for AuthnRequest accessors""" self.ar.id = "request id" - self.ar.version = saml.V2 + self.ar.version = saml2.VERSION self.ar.issue_instant = "2007-09-14T01:05:02Z" self.ar.destination = "http://www.example.com/Destination" self.ar.consent = saml.CONSENT_UNSPECIFIED @@ -378,7 +378,7 @@ class TestAuthnRequest: new_ar = samlp.authn_request_from_string(self.ar.to_string()) assert new_ar.id == "request id" - assert new_ar.version == saml.V2 + assert new_ar.version == saml2.VERSION assert new_ar.issue_instant == "2007-09-14T01:05:02Z" assert new_ar.destination == "http://www.example.com/Destination" assert new_ar.consent == saml.CONSENT_UNSPECIFIED @@ -405,7 +405,7 @@ class TestAuthnRequest: """Test for authn_request_from_string() using test data""" new_ar = samlp.authn_request_from_string(samlp_data.TEST_AUTHN_REQUEST) assert new_ar.id == "request id" - assert new_ar.version == saml.V2 + assert new_ar.version == saml2.VERSION assert new_ar.issue_instant == "2007-09-14T01:05:02Z" assert new_ar.destination == "http://www.example.com/Destination" assert new_ar.consent == saml.CONSENT_UNSPECIFIED @@ -437,7 +437,7 @@ class TestLogoutRequest: def testAccessors(self): """Test for LogoutRequest accessors""" self.lr.id = "request id" - self.lr.version = saml.V2 + self.lr.version = saml2.VERSION self.lr.issue_instant = "2007-09-14T01:05:02Z" self.lr.destination = "http://www.example.com/Destination" self.lr.consent = saml.CONSENT_UNSPECIFIED @@ -454,7 +454,7 @@ class TestLogoutRequest: new_lr = samlp.logout_request_from_string(self.lr.to_string()) assert new_lr.id == "request id" - assert new_lr.version == saml.V2 + assert new_lr.version == saml2.VERSION assert new_lr.issue_instant == "2007-09-14T01:05:02Z" assert new_lr.destination == "http://www.example.com/Destination" assert new_lr.consent == saml.CONSENT_UNSPECIFIED @@ -472,7 +472,7 @@ class TestLogoutRequest: """Test for logout_request_from_string() using test data""" new_lr = samlp.logout_request_from_string(samlp_data.TEST_LOGOUT_REQUEST) assert new_lr.id == "request id" - assert new_lr.version == saml.V2 + assert new_lr.version == saml2.VERSION assert new_lr.issue_instant == "2007-09-14T01:05:02Z" assert new_lr.destination == "http://www.example.com/Destination" assert new_lr.consent == saml.CONSENT_UNSPECIFIED @@ -497,7 +497,7 @@ class TestLogoutResponse: """Test for LogoutResponse accessors""" self.lr.id = "response id" self.lr.in_response_to = "request id" - self.lr.version = saml.V2 + self.lr.version = saml2.VERSION self.lr.issue_instant = "2007-09-14T01:05:02Z" self.lr.destination = "http://www.example.com/Destination" self.lr.consent = saml.CONSENT_UNSPECIFIED @@ -509,7 +509,7 @@ class TestLogoutResponse: new_lr = samlp.logout_response_from_string(self.lr.to_string()) assert new_lr.id == "response id" assert new_lr.in_response_to == "request id" - assert new_lr.version == saml.V2 + assert new_lr.version == saml2.VERSION assert new_lr.issue_instant == "2007-09-14T01:05:02Z" assert new_lr.destination == "http://www.example.com/Destination" assert new_lr.consent == saml.CONSENT_UNSPECIFIED @@ -524,7 +524,7 @@ class TestLogoutResponse: samlp_data.TEST_LOGOUT_RESPONSE) assert new_lr.id == "response id" assert new_lr.in_response_to == "request id" - assert new_lr.version == saml.V2 + assert new_lr.version == saml2.VERSION assert new_lr.issue_instant == "2007-09-14T01:05:02Z" assert new_lr.destination == "http://www.example.com/Destination" assert new_lr.consent == saml.CONSENT_UNSPECIFIED diff --git a/tests/test_xmldsig.py b/tests/test_xmldsig.py index fd10c73..e3822bf 100644 --- a/tests/test_xmldsig.py +++ b/tests/test_xmldsig.py @@ -33,18 +33,18 @@ class TestObject: def testAccessors(self): """Test for Object accessors""" - self.object.id = "object_id" + self.object.identifier = "object_id" self.object.mime_type = "test/plain; charset=UTF-8" self.object.encoding = ds.ENCODING_BASE64 new_object = ds.object_from_string(self.object.to_string()) - assert new_object.id == "object_id" + assert new_object.identifier == "object_id" assert new_object.mime_type == "test/plain; charset=UTF-8" assert new_object.encoding == ds.ENCODING_BASE64 def testUsingTestData(self): """Test for object_from_string() using test data""" new_object = ds.object_from_string(ds_data.TEST_OBJECT) - assert new_object.id == "object_id" + assert new_object.identifier == "object_id" assert new_object.encoding == ds.ENCODING_BASE64 assert new_object.text.strip() == \ "V2VkIEp1biAgNCAxMjoxMTowMyBFRFQgMjAwMwo" @@ -424,7 +424,7 @@ class TestKeyInfo: ds.spki_data_from_string(ds_data.TEST_SPKI_DATA)) self.key_info.mgmt_data.append( ds.mgmt_data_from_string(ds_data.TEST_MGMT_DATA)) - self.key_info.id = "id" + self.key_info.identifier = "id" new_key_info = ds.key_info_from_string(self.key_info.to_string()) assert isinstance(new_key_info.key_name[0], ds.KeyName) @@ -435,7 +435,7 @@ class TestKeyInfo: assert isinstance(new_key_info.pgp_data[0], ds.PGPData) assert isinstance(new_key_info.spki_data[0], ds.SPKIData) assert isinstance(new_key_info.mgmt_data[0], ds.MgmtData) - assert new_key_info.id == "id" + assert new_key_info.identifier == "id" def testUsingTestData(self): """Test for key_info_from_string() using test data""" @@ -448,7 +448,7 @@ class TestKeyInfo: assert isinstance(new_key_info.pgp_data[0], ds.PGPData) assert isinstance(new_key_info.spki_data[0], ds.SPKIData) assert isinstance(new_key_info.mgmt_data[0], ds.MgmtData) - assert new_key_info.id == "id" + assert new_key_info.identifier == "id" class TestDigestValue: @@ -500,14 +500,14 @@ class TestReference: ds_data.TEST_DIGEST_METHOD)) self.reference.digest_value.append(ds.digest_value_from_string( ds_data.TEST_DIGEST_VALUE)) - self.reference.id = "id" + self.reference.identifier = "id" self.reference.uri = "http://www.example.com/URI" self.reference.type = "http://www.example.com/Type" new_reference = ds.reference_from_string(self.reference.to_string()) assert isinstance(new_reference.transforms[0], ds.Transforms) assert isinstance(new_reference.digest_method[0], ds.DigestMethod) assert isinstance(new_reference.digest_value[0], ds.DigestValue) - assert new_reference.id == "id" + assert new_reference.identifier == "id" assert new_reference.uri == "http://www.example.com/URI" assert new_reference.type == "http://www.example.com/Type" @@ -517,7 +517,7 @@ class TestReference: assert isinstance(new_reference.transforms[0], ds.Transforms) assert isinstance(new_reference.digest_method[0], ds.DigestMethod) assert isinstance(new_reference.digest_value[0], ds.DigestValue) - assert new_reference.id == "id" + assert new_reference.identifier == "id" assert new_reference.uri == "http://www.example.com/URI" assert new_reference.type == "http://www.example.com/Type" @@ -574,7 +574,7 @@ class TestSignedInfo: def testAccessors(self): """Test for SignedInfo accessors""" - self.si.id = "id" + self.si.identifier = "id" self.si.canonicalization_method = ds.canonicalization_method_from_string( ds_data.TEST_CANONICALIZATION_METHOD) self.si.signature_method = ds.signature_method_from_string( @@ -582,7 +582,7 @@ class TestSignedInfo: self.si.reference.append(ds.reference_from_string( ds_data.TEST_REFERENCE)) new_si = ds.signed_info_from_string(self.si.to_string()) - assert new_si.id == "id" + assert new_si.identifier == "id" assert isinstance(new_si.canonicalization_method, ds.CanonicalizationMethod) assert isinstance(new_si.signature_method, ds.SignatureMethod) @@ -591,7 +591,7 @@ class TestSignedInfo: def testUsingTestData(self): """Test for signed_info_from_string() using test data""" new_si = ds.signed_info_from_string(ds_data.TEST_SIGNED_INFO) - assert new_si.id == "id" + assert new_si.identifier == "id" assert isinstance(new_si.canonicalization_method, ds.CanonicalizationMethod) assert isinstance(new_si.signature_method, ds.SignatureMethod) @@ -604,18 +604,18 @@ class TestSignatureValue: def testAccessors(self): """Test for SignatureValue accessors""" - self.signature_value.id = "id" + self.signature_value.identifier = "id" self.signature_value.text = "signature value" new_signature_value = ds.signature_value_from_string( self.signature_value.to_string()) - assert new_signature_value.id == "id" + assert new_signature_value.identifier == "id" assert new_signature_value.text.strip() == "signature value" def testUsingTestData(self): """Test for signature_value_from_string() using test data""" new_signature_value = ds.signature_value_from_string( ds_data.TEST_SIGNATURE_VALUE) - assert new_signature_value.id == "id" + assert new_signature_value.identifier == "id" assert new_signature_value.text.strip() == "signature value" @@ -626,7 +626,7 @@ class TestSignature: def testAccessors(self): """Test for Signature accessors""" - self.signature.id = "id" + self.signature.identifier = "id" self.signature.signed_info = ds.signed_info_from_string( ds_data.TEST_SIGNED_INFO) self.signature.signature_value = ds.signature_value_from_string( @@ -635,7 +635,7 @@ class TestSignature: self.signature.object.append(ds.object_from_string(ds_data.TEST_OBJECT)) new_signature = ds.signature_from_string(self.signature.to_string()) - assert new_signature.id == "id" + assert new_signature.identifier == "id" assert isinstance(new_signature.signed_info, ds.SignedInfo) assert isinstance(new_signature.signature_value, ds.SignatureValue) assert isinstance(new_signature.key_info, ds.KeyInfo) @@ -644,7 +644,7 @@ class TestSignature: def testUsingTestData(self): """Test for signature_value_from_string() using test data""" new_signature = ds.signature_from_string(ds_data.TEST_SIGNATURE) - assert new_signature.id == "id" + assert new_signature.identifier == "id" assert isinstance(new_signature.signed_info, ds.SignedInfo) assert isinstance(new_signature.signature_value, ds.SignatureValue) assert isinstance(new_signature.key_info, ds.KeyInfo)