blob: 6eca0a34adf26aa22d3c6bb55d66ab04d4926347 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
from unittest.mock import MagicMock
def createMockedExtruder(extruder_id):
extruder = MagicMock()
extruder.getId = MagicMock(return_value = extruder_id)
return extruder
def test_getAllExtruderSettings(extruder_manager):
extruder_1 = createMockedExtruder("extruder_1")
extruder_1.getProperty = MagicMock(return_value ="beep")
extruder_2 = createMockedExtruder("extruder_2")
extruder_2.getProperty = MagicMock(return_value="zomg")
extruder_manager.getActiveExtruderStacks = MagicMock(return_value = [extruder_1, extruder_2])
assert extruder_manager.getAllExtruderSettings("whatever", "value") == ["beep", "zomg"]
|