1import pytest 2 3from UM.Scene.ToolHandle import ToolHandle 4 5test_validate_data = [ 6 {"attribute": "LineMesh", "value": "whatever"}, 7 {"attribute": "SolidMesh", "value": "blorp"}, 8 {"attribute": "SelectionMesh", "value": "omgzomg"} 9] 10 11@pytest.mark.parametrize("data", test_validate_data) 12def test_getAndSet(data): 13 tool_handle = ToolHandle() 14 15 # Attempt to set the value 16 getattr(tool_handle, "set" + data["attribute"])(data["value"]) 17 18 # Ensure that the value got set 19 assert getattr(tool_handle, "get" + data["attribute"])() == data["value"] 20