mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Add test for getCurrentQualityGroups if there is no current printer
Contributes to issue CURA-6600.
This commit is contained in:
parent
d9e94f5019
commit
10f37c98ff
1 changed files with 10 additions and 0 deletions
|
@ -4,6 +4,8 @@ from UM.Settings.DefinitionContainer import DefinitionContainer
|
|||
from cura.Machines.ContainerTree import ContainerTree
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
|
||||
import cura.CuraApplication # DEBUG!
|
||||
|
||||
|
||||
def createMockedStack(definition_id: str):
|
||||
result = MagicMock(spec = GlobalStack)
|
||||
|
@ -54,3 +56,11 @@ def test_alreadyKnownMachineAdded(container_registry):
|
|||
# The ID is already there, so no machine should be added.
|
||||
container_tree._machineAdded(mocked_definition_container)
|
||||
assert len(container_tree.machines) == 2
|
||||
|
||||
def test_getCurrentQualityGroupsNoGlobalStack(container_registry):
|
||||
with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
|
||||
with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value = MagicMock(getGlobalContainerStack = MagicMock(return_value = None)))):
|
||||
container_tree = ContainerTree()
|
||||
result = container_tree.getCurrentQualityGroups()
|
||||
|
||||
assert len(result) == 0
|
Loading…
Add table
Add a link
Reference in a new issue