mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 14:53:14 +08:00
Add test for getMachine function
This commit is contained in:
parent
3dde93e7f4
commit
b6de376b02
@ -53,6 +53,16 @@ def test_setActiveMachine(machine_manager):
|
||||
machine_manager._application.setGlobalContainerStack.assert_called_with(mocked_global_stack)
|
||||
|
||||
|
||||
def test_getMachine():
|
||||
registry = MagicMock()
|
||||
mocked_global_stack = MagicMock()
|
||||
mocked_global_stack.getId = MagicMock(return_value="test_machine")
|
||||
mocked_global_stack.definition.getId = MagicMock(return_value = "test")
|
||||
registry.findContainerStacks = MagicMock(return_value=[mocked_global_stack])
|
||||
with patch("cura.Settings.CuraContainerRegistry.CuraContainerRegistry.getInstance", MagicMock(return_value=registry)):
|
||||
assert MachineManager.getMachine("test") == mocked_global_stack
|
||||
|
||||
|
||||
def test_hasUserSettings(machine_manager, application):
|
||||
mocked_stack = application.getGlobalContainerStack()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user