def test_set_data_on_invalid(self): # given view = CreateRenderView() self.source = source = PointSource( Center=(0.0, 0.0, 0.0), NumberOfPoints=1, Radius=2.0) self.sources.append(source) vtkfilter = ProgrammableFilter( Input=source, Script=add_cell_data_filter_script.format(CUBA.MASS.name)) self.sources.append(vtkfilter) representation = CreateRepresentation(vtkfilter, view) # when/then with self.assertRaises(ValueError): set_data(representation, vtkfilter, select=(CUBA.MASS, 'cells'))
def test_set_data_on_cells(self, setup): # given view = CreateRenderView() self.source = source = PointSource( Center=(0.0, 0.0, 0.0), NumberOfPoints=1, Radius=2.0) self.sources.append(source) vtkfilter = ProgrammableFilter( Input=source, Script=add_cell_data_filter_script.format(CUBA.MASS.name)) self.sources.append(vtkfilter) representation = CreateRepresentation(vtkfilter, view) # when set_data(representation, vtkfilter, select=(CUBA.MASS, setup)) # then self.assertEqual(representation.ColorAttributeType, 'CELL_DATA')