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.encoding == ds.ENCODING_BASE64 assert new_object.text.strip() == \ "V2VkIEp1biAgNCAxMjoxMTowMyBFRFQgMjAwMwo"
def testAccessors(self): """Test for Object accessors""" self.object.id = "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.mime_type == "test/plain; charset=UTF-8" assert new_object.encoding == ds.ENCODING_BASE64
def testAccessors(self): """Test for Signature accessors""" self.signature.id = "id" self.signature.signed_info = ds.signed_info_from_string( ds_data.TEST_SIGNED_INFO) self.signature.signature_value = ds.signature_value_from_string( ds_data.TEST_SIGNATURE_VALUE) self.signature.key_info = ds.key_info_from_string(ds_data.TEST_KEY_INFO) 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 isinstance(new_signature.signed_info, ds.SignedInfo) assert isinstance(new_signature.signature_value, ds.SignatureValue) assert isinstance(new_signature.key_info, ds.KeyInfo) assert isinstance(new_signature.object[0], ds.Object)