def test_GIVEN_unknown_transformation_type_WHEN_adding_transformation_THEN_raises_value_error(
        component_tree_view, component_model):
    sample_component_index = get_sample_index(component_tree_view)
    component_tree_view.setCurrentIndex(sample_component_index)
    with pytest.raises(ValueError):
        add_transformation("NotAKnownTransformation", component_tree_view,
                           component_model)
def test_GIVEN_rotation_is_added_WHEN_adding_transformation_THEN_rotation_is_added_to_component(
        component_tree_view, component_model):
    sample_component_index = get_sample_index(component_tree_view)
    component_tree_view.setCurrentIndex(sample_component_index)
    add_transformation(TransformationType.ROTATION, component_tree_view,
                       component_model)
    sample_component = sample_component_index.internalPointer()

    assert len(sample_component.transforms) == 1
    assert sample_component.transforms[0].type == "Rotation"
Beispiel #3
0
 def _add_transformation(self, transformation_type: TransformationType):
     add_transformation(
         transformation_type, self.component_tree_view, self.component_model
     )
Beispiel #4
0
 def _add_transformation(self, transformation_type: str):
     add_transformation(transformation_type, self.component_tree_view,
                        self.component_model)
     self._set_button_state()