278 Commits

Author SHA1 Message Date
Ghostkeeper
fde9449358
Add test to ensure that no definitions define new settings
See the documentation of the test.
2021-03-08 16:53:48 +01:00
Jaime van Kessel
0493fb24df
Add extra human readable strings to asserts 2020-10-09 15:08:27 +02:00
Jaime van Kessel
8f4dd3cb12
Made the asserts of the profile tests a bit more explicit
This makes it easier to read the test outcome, since it gives
much better hints what can / needs to be done to fix it.
2020-10-09 14:02:47 +02:00
Jaime van Kessel
bfef61ad81
Use fastConfigParser for the versionUpToDate test
This makes the test a fair bit faster!
2020-10-09 13:58:26 +02:00
Jaime van Kessel
f31490125c
Add test to check if profile ID's are unique
CURA-7763
2020-10-09 13:53:58 +02:00
Jaime van Kessel
43efac491d
Fix the unit test
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.
2020-08-14 15:41:40 +02:00
Jaime van Kessel
cb657ac45a
Some minor stylechanges in tests 2020-06-19 15:34:13 +02:00
Jaime van Kessel
ea0c8ff9bc
Implement setDirty for mockContainer 2020-06-18 18:05:07 +02:00
Ghostkeeper
93c84d5bc0
Mock the limit_to_extruder property with an actual value
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.
2020-06-02 14:01:09 +02:00
Ghostkeeper
825a34d418
Mock the extruderList
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.
2020-06-02 13:46:17 +02:00
Ghostkeeper
0d9053881c
Remove use of deprecated extruders property
Removes lots of warnings from the test log, since there the logger doesn't prevent creating multiple of those.

Done during Turbo Testing and Tooling.
2020-05-29 17:47:56 +02:00
Ghostkeeper
e098f98a7d
Remove unused mock of extruders property
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.
2020-05-29 17:35:42 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Nino van Hooff
ff3f4c99a8 Remove incorrect comment 2020-05-28 17:34:04 +02:00
Nino van Hooff
c2c96faf5f Convert remaining doxygen to rst 2020-05-28 17:13:44 +02:00
Ghostkeeper
17af83bc19
Also test for the normal Version number
It rarely changes so it's less of a problem, but you never know.
2020-05-08 12:18:48 +02:00
Ghostkeeper
6baca9eaa2
Also test intent profiles
Contributes to issue CURA-7420.
2020-05-08 12:13:06 +02:00
Ghostkeeper
c61f3b04ba
Add test for all built-in profiles being up to date
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.
2020-05-08 11:26:37 +02:00
Ghostkeeper
f4f990708f
Remove old 'category' metadata
Most of it was incorrect and very inconsistent too. These are not used by our code any more.
2020-04-28 09:27:31 +02:00
Jaime van Kessel
2e9dca71ce
Remove a number of unused imports 2020-04-10 13:58:10 +02:00
Jaime van Kessel
3cc7382c12
Remove some unused code from TestCuraStackBuilder 2020-02-28 14:29:26 +01:00
Ghostkeeper
a8ccec709f
Add test for spaces in definition IDs
Contributes to issue CURA-7201.
2020-02-07 13:55:24 +01:00
Jaime van Kessel
9de2b39d38
Fix the failing tests
CURA-6255
2020-01-02 11:13:48 +01:00
Jaime van Kessel
24a5cbfacb
Make test a bit more readable 2019-12-20 15:21:59 +01:00
Lipu Fei
34c080c4bd Add _trustHook() to MockContainer
CURA-6856
2019-11-07 09:55:44 +01:00
Lipu Fei
d346dd4090 Fix TestDefinitionContainer 2019-11-06 15:43:43 +01:00
Ghostkeeper
c7c6389897
Report on all faulty keys at once instead of crashing on first
This makes it a lot easier to communicate back to users what is going wrong.
2019-11-04 11:50:57 +01:00
Ghostkeeper
1f4c863683
Also assert that the extruder_nr setting matches 2019-11-01 15:08:09 +01:00
Ghostkeeper
069dc6e65d
Add test to see if definition's extruder number matches up
...with its machine definition's metadata.
2019-11-01 14:52:41 +01:00
Ghostkeeper
6e6c510dcd
Test extruders for correctness but not for validity
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.
2019-11-01 14:34:07 +01:00
Ghostkeeper
174b326f57
Also test validity and correctness of extruder definitions
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.
2019-11-01 14:18:35 +01:00
Ghostkeeper
985aac9e60
Assert that there is no ID metadata entry in definition containers 2019-10-22 11:01:16 +02:00
Ghostkeeper
51c3acc654
Document helper functions 2019-10-22 09:56:50 +02:00
Ghostkeeper
15ea29924a
Sort definition files before testing them
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.
2019-10-18 17:02:40 +02:00
Ghostkeeper
1d7ad38db2
Also name which setting has the dysfunctional override
So that it's easier to remove it.

Done during Turbo Testing & Tooling.
2019-10-18 17:00:47 +02:00
Ghostkeeper
76b5f9d37b
Fix testing if JSON elements are mappings
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.
2019-10-18 16:57:57 +02:00
Ghostkeeper
9316df72b3
Add test for overriding default_value while there is a value
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.
2019-10-18 16:45:15 +02:00
Ghostkeeper
5ae248341b
Add test for getting quality groups from the container tree
Finally it works.

Done during turbo testing and tooling.
2019-10-04 15:35:33 +02:00
Ghostkeeper
557746a832
Partial fix for intent manager not finding correct profile in test
Only in test.
2019-09-23 15:17:15 +02:00
Jaime van Kessel
3a2c5b2473
Fix test for stack builder 2019-09-23 13:26:21 +02:00
Ghostkeeper
61527e082e
Mock ContainerTree instead of ContainerRegistry
The intent models are now using the ContainerTree to build themselves rather than the registry.
2019-09-23 09:59:57 +02:00
Diego Prado Gesto
b18565d9cf Merge branch 'master' into feature_intent_container_tree 2019-09-10 11:08:21 +02:00
Lipu Fei
dba3b77f61 Fix tests
CURA-6598
2019-09-09 16:45:39 +02:00
Jaime van Kessel
f540abbd73
Expand the createUniqueName test 2019-09-06 15:13:25 +02:00
Jaime van Kessel
d9e94f5019 Fix tests 2019-08-29 17:07:36 +02:00
Jaime van Kessel
784ab6e903 Add missing isDirty function
CURA-6600
2019-08-29 16:36:11 +02:00
Remco Burema
7fb9642e45 Replace deprecated .getContainer() calls with .container
part of CURA-6600
2019-08-15 13:40:08 +02:00
Ghostkeeper
6a5f425468
Fix running tests via CMake
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.
2019-08-13 16:20:21 +02:00
Ghostkeeper
6a8e1557c3
Merge branch 'feature_intent' into feature_intent_container_tree
Conflicts:
	.gitlab-ci.yml
	cura/Machines/MaterialManager.py
	cura/Machines/VariantManager.py
	cura/Settings/ContainerManager.py
	cura/Settings/MachineManager.py
	tests/TestMachineManager.py
2019-08-13 14:59:05 +02:00
Ghostkeeper
20201c65e6
Merge branch 'master' into feature_intent
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
2019-08-13 14:43:28 +02:00