Expand the getMachine test

This commit is contained in:
Jaime van Kessel 2020-08-21 15:16:29 +02:00
parent ce930220e9
commit e1e0a4d32c
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -34,6 +34,8 @@ def test_getMachine():
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
# Since only test is in the registry, this should be None
assert MachineManager.getMachine("UnknownMachine") is None
def test_addMachine(machine_manager):
@ -134,7 +136,7 @@ def test_setActiveMachine(machine_manager):
machine_action_manager.addDefaultMachineActions.assert_called_once_with(global_stack)
# Yeah sure. It's technically an implementation detail. But if this function wasn't called, it exited early somehow
machine_manager._validateVariantsAndMaterials.assert_called_once_with(global_stack)
def test_setInvalidActiveMachine(machine_manager):
registry = MagicMock()