def testUsingTestData(self): """Test for transform_from_string() using test data""" new_transforms = ds.transforms_from_string(ds_data.TEST_TRANSFORMS) assert isinstance(new_transforms.transform[0], ds.Transform) assert isinstance(new_transforms.transform[1], ds.Transform) assert new_transforms.transform[0].algorithm == \ ds.TRANSFORM_ENVELOPED assert new_transforms.transform[1].algorithm == \ ds.TRANSFORM_ENVELOPED assert new_transforms.transform[0].x_path[0].text.strip() == "xpath" assert new_transforms.transform[1].x_path[0].text.strip() == "xpath"
def testAccessors(self): """Test for RetrievalMethod accessors""" self.retrieval_method.uri = "http://www.example.com/URI" self.retrieval_method.type = "http://www.example.com/Type" self.retrieval_method.transforms = ds.transforms_from_string( ds_data.TEST_TRANSFORMS) new_retrieval_method = ds.retrieval_method_from_string( self.retrieval_method.to_string()) assert new_retrieval_method.uri == "http://www.example.com/URI" assert new_retrieval_method.type == "http://www.example.com/Type" assert isinstance(new_retrieval_method.transforms, ds.Transforms)
def testAccessors(self): """Test for Transforms accessors""" self.transforms.transform.append( ds.transform_from_string(ds_data.TEST_TRANSFORM)) self.transforms.transform.append( ds.transform_from_string(ds_data.TEST_TRANSFORM)) new_transforms = ds.transforms_from_string(self.transforms.to_string()) assert isinstance(new_transforms.transform[0], ds.Transform) assert isinstance(new_transforms.transform[1], ds.Transform) assert new_transforms.transform[0].algorithm == \ ds.TRANSFORM_ENVELOPED assert new_transforms.transform[1].algorithm == \ ds.TRANSFORM_ENVELOPED assert new_transforms.transform[0].x_path[0].text.strip() == "xpath" assert new_transforms.transform[1].x_path[0].text.strip() == "xpath"
def testAccessors(self): """Test for Reference accessors""" self.reference.transforms = ds.transforms_from_string( ds_data.TEST_TRANSFORMS) self.reference.digest_method = ds.digest_method_from_string( ds_data.TEST_DIGEST_METHOD) self.reference.digest_value = ds.digest_value_from_string( ds_data.TEST_DIGEST_VALUE) self.reference.id = "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, ds.Transforms) assert isinstance(new_reference.digest_method, ds.DigestMethod) assert isinstance(new_reference.digest_value, ds.DigestValue) assert new_reference.id == "id" assert new_reference.uri == "http://www.example.com/URI" assert new_reference.type == "http://www.example.com/Type"