mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Add test for getting current quality changes groups
Similar to getting the current quality groups. Contributes to issue CURA-6600.
This commit is contained in:
parent
ea5530c507
commit
7f192ce36f
1 changed files with 16 additions and 1 deletions
|
@ -101,4 +101,19 @@ def test_getCurrentQualityChangesGroupsNoGlobalStack(container_registry):
|
|||
container_tree = ContainerTree()
|
||||
result = container_tree.getCurrentQualityChangesGroups()
|
||||
|
||||
assert len(result) == 0
|
||||
assert len(result) == 0
|
||||
|
||||
def test_getCurrentQualityChangesGroups(container_registry, application):
|
||||
with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
|
||||
container_tree = ContainerTree()
|
||||
container_tree.machines["current_global_stack"] = MagicMock() # Mock so that we can track whether the getQualityGroups function gets called with correct parameters.
|
||||
|
||||
with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value = application)):
|
||||
result = container_tree.getCurrentQualityChangesGroups()
|
||||
|
||||
# As defined in the fixture for application.
|
||||
expected_variant_names = ["current_global_stack_left_variant_name", "current_global_stack_right_variant_name"]
|
||||
expected_material_base_files = ["current_global_stack_left_material_base_file", "current_global_stack_right_material_base_file"]
|
||||
expected_is_enabled = [True, True]
|
||||
|
||||
container_tree.machines["current_global_stack"].getQualityChangesGroups.assert_called_with(expected_variant_names, expected_material_base_files, expected_is_enabled)
|
Loading…
Add table
Add a link
Reference in a new issue