Example #1
0
 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"
Example #2
0
 def testAccessors(self):
   """Test for Transform accessors"""
   self.transform.x_path.append(ds.TransformType_XPath(text="xpath"))
   self.transform.algorithm = ds.TRANSFORM_ENVELOPED
   new_transform = ds.transform_from_string(self.transform.to_string())
   assert isinstance(new_transform.x_path[0], ds.TransformType_XPath)
   assert new_transform.x_path[0].text.strip() == "xpath"
   assert new_transform.algorithm == ds.TRANSFORM_ENVELOPED
Example #3
0
 def testUsingTestData(self):
   """Test for transform_from_string() using test data"""
   new_transform = ds.transform_from_string(ds_data.TEST_TRANSFORM)
   assert isinstance(new_transform.x_path[0], ds.TransformType_XPath)
   assert new_transform.x_path[0].text.strip() == "xpath"
   assert new_transform.algorithm == ds.TRANSFORM_ENVELOPED