mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 04:49:01 +08:00
Add test for gcodeListDecorator
It's super simple, but hey, it's also easy to write.
This commit is contained in:
parent
c7e3b1dcaf
commit
67a63e7954
@ -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
|
||||
return copied_decorator
|
||||
|
16
tests/TestGCodeListDecorator.py
Normal file
16
tests/TestGCodeListDecorator.py
Normal file
@ -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()
|
Loading…
x
Reference in New Issue
Block a user