Previously we would only look at the state, but that isn't the only thing it should look at.
It should override the value of a resolve if it's defined in user changes or QualityChanges.
This is necessary because our code now converts this to an integer. Mocks can't be converted to an integer, so the sub-magic-mock here can't be used. We need to provide something that can be cast to an integer.
Otherwise the list of extruders becomes a MagicMock. Adding a list to a MagicMock is again a MagicMock, and when iterating over that it doesn't result in any iterations. As a result, the for loop that clears all user containers didn't clear anything and the test failed.
The extruders property is no longer being used by the code under test, so this mock is unnecessary. It's also a deprecated property.
Done during Turbo Testing and Tooling.
So we had several hundred files outdated already. It's happened before. It shaln't happen again.
This test fails right now because there is one file still on setting_version 6.
Contributes to issue CURA-7420.
The validity can't be tested using the built-in validator since that one checks if there are no settings that 'override' non-existing settings. And some of the settings overridden in an extruder are not in the inheritance stack since fdmextruder doesn't inherit from fdmprinter.
We'll check though that all settings that are overridden don't override a default_value while there is a value, and whether they don't have IDs.
This makes a few things slightly simpler as well since it now parameterises the tests with the entire path of the definition file so we don't have to reconstruct that in every test.
When going through the list of tests for many printers to fix them, it's then easier to go through the failed list. They will appear in the same order as in my IDE. Just a bit of an ease of life thing without any real cost.
Done during Turbo Testing & Tooling.
Turns out that the JSON objects extend from dict, so this works.
Also turns out that strings have a __getitem__. Who knew?
Done during Turbo Testing & Tooling.
This should not be done anywhere since the default_value won't have any effect then. We disregard CuraEngine's command line method here but that's infeasible with those profiles anyway.
Done during Turbo Testing & Tooling.
The Settings folder conflicts with the same folder in Uranium, so it couldn't find MockContainer from the Uranium version.
Contributes to issue CURA-6600.
Conflicts:
resources/bundled_packages/cura.json -> 4.1 to 4.2 upgrade package added simultaneously
tests/TestMachineManager.py -> Due to changes in conftest.py
tests/conftest.py -> Simultaneously expanding the magic mocks to have some correct properties