mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Add test for getMachine function
This commit is contained in:
parent
3dde93e7f4
commit
b6de376b02
1 changed files with 10 additions and 0 deletions
|
@ -53,6 +53,16 @@ def test_setActiveMachine(machine_manager):
|
||||||
machine_manager._application.setGlobalContainerStack.assert_called_with(mocked_global_stack)
|
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):
|
def test_hasUserSettings(machine_manager, application):
|
||||||
mocked_stack = application.getGlobalContainerStack()
|
mocked_stack = application.getGlobalContainerStack()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue