diff --git a/cura/Scene/GCodeListDecorator.py b/cura/Scene/GCodeListDecorator.py index 572fea6ac4..d3dadb3f23 100644 --- a/cura/Scene/GCodeListDecorator.py +++ b/cura/Scene/GCodeListDecorator.py @@ -10,10 +10,10 @@ class GCodeListDecorator(SceneNodeDecorator): def getGCodeList(self) -> List[str]: return self._gcode_list - def setGCodeList(self, list: List[str]): + def setGCodeList(self, list: List[str]) -> None: self._gcode_list = list def __deepcopy__(self, memo) -> "GCodeListDecorator": copied_decorator = GCodeListDecorator() copied_decorator.setGCodeList(self.getGCodeList()) - return copied_decorator \ No newline at end of file + return copied_decorator diff --git a/tests/TestGCodeListDecorator.py b/tests/TestGCodeListDecorator.py new file mode 100644 index 0000000000..058aa132f9 --- /dev/null +++ b/tests/TestGCodeListDecorator.py @@ -0,0 +1,16 @@ +from cura.Scene.GCodeListDecorator import GCodeListDecorator + + +def test_setAndGetList(): + decorator = GCodeListDecorator() + + decorator.setGCodeList(["Test"]) + assert decorator.getGCodeList() == ["Test"] + + +def test_copyGCodeDecorator(): + decorator = GCodeListDecorator() + decorator.setGCodeList(["Test"]) + import copy + copied_decorator = copy.deepcopy(decorator) + assert decorator.getGCodeList() == copied_decorator.getGCodeList()