mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Make cache of machines a protected field
We don't want to use it outside of the mapping. This mapping should be transparent. We are still using it from our tests though but that's fine. Tests are allowed to touch private fields. Contributes to issue CURA-6793.
This commit is contained in:
parent
5624f0a8ae
commit
8179dfc412
2 changed files with 8 additions and 8 deletions
|
@ -55,7 +55,7 @@ def test_getCurrentQualityGroupsNoGlobalStack(container_registry):
|
|||
def test_getCurrentQualityGroups(container_registry, application):
|
||||
with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
|
||||
container_tree = ContainerTree()
|
||||
container_tree.machines.machines["current_global_stack"] = MagicMock() # Mock so that we can track whether the getQualityGroups function gets called with correct parameters.
|
||||
container_tree.machines._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.getCurrentQualityGroups()
|
||||
|
@ -79,7 +79,7 @@ def test_getCurrentQualityChangesGroupsNoGlobalStack(container_registry):
|
|||
def test_getCurrentQualityChangesGroups(container_registry, application):
|
||||
with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
|
||||
container_tree = ContainerTree()
|
||||
container_tree.machines.machines["current_global_stack"] = MagicMock() # Mock so that we can track whether the getQualityGroups function gets called with correct parameters.
|
||||
container_tree.machines._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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue