51 Commits

Author SHA1 Message Date
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
Jaime van Kessel
3748b256ce Add a few more simple tests for extruder stack 2019-05-24 17:28:42 +02:00
Lipu Fei
c20274e356 Move constant instance containers to a separate file
This way we separate the class/type definitions and the actual
constants.
2018-08-15 11:04:09 +02:00
Diego Prado Gesto
b85950b128 Fix tests in the ExtruderStack.
Contributes to CURA-5628.
2018-08-14 15:40:11 +02:00
Diego Prado Gesto
db7f1242cd Fix some unit tests.
Add fixtures to the conftest file and clean-up the code a bit.

Contributes to CURA-5628
2018-08-14 10:41:38 +02:00
Lipu Fei
af02dc2758 Only use setMetaDataEntry() 2018-07-11 11:14:57 +02:00
Ghostkeeper
e38228ac24
Remove unused target_container parameter
It's not compatible with ContainerInterface anyway.

Contributes to issue CURA-5330.
2018-06-01 14:53:54 +02:00
Lipu Fei
12164a0c88 WIP: Remove set..ById()s in CuraContainerStack 2018-02-16 14:23:11 +01:00
Aleksei S
47925ec3bc PyTest fix: The extruder stack test is failed 2018-02-06 18:51:11 +01:00
Aleksei S
2c18127cc1 Tests: Removed python circular import dependency and added empty containers
CURA-4687
2017-12-15 09:43:02 +01:00
Lipu Fei
7d46eead60 Fix broken unit tests due to evaluation context
CURA-4498
2017-10-26 12:49:41 +02:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Jaime van Kessel
da63932a95 Fixes unit fallthrough unit test
CURA-3738
2017-05-15 11:36:02 +02:00
Arjen Hiemstra
fe112d5d81 Fix extruderstack test on CI
We do not need a complete CuraApplication just so registerExtruder
can work. Instead, we just mock away the extruder manager so the rest of
the test can proceed.
2017-05-04 13:06:34 +02:00
Jaime van Kessel
e6e442348b Fixed one of the tests
The test failed due to it not creating the right application CURA-3497
2017-05-01 16:10:05 +02:00
Arjen Hiemstra
0c232c9462 ExtruderStack requires a next stack, so make sure it has that in tests 2017-04-12 12:06:02 +02:00
Ghostkeeper
70055d35c0
Remove superfluous mocking and fixtures
These are now no longer used by the tests.

Contributes to issue CURA-3497.
2017-04-12 10:00:45 +02:00
Ghostkeeper
eaf180c150
Let setProperty tests test only whether setProperty on container is called
This makes these tests more simple to mock and stuff and also removes all dependencies of these tests.

Contributes to issue CURA-3497.
2017-04-12 10:00:45 +02:00
Ghostkeeper
06797abafe
Change expected exception in test_set...ByIdDoesntExist
It should raise an InvalidContainerError rather than a KeyError.

Contributes to issue CURA-3497.
2017-04-12 10:00:45 +02:00
Ghostkeeper
0e82c84790
Let test_setVariantByIdExists use new container registry functionality
It sets the container it expects beforehand and tests for its ID.

Contributes to issue CURA-3497.
2017-04-12 10:00:45 +02:00
Ghostkeeper
4db7c6ae66
Let test_setQualityChangesByIdExists use new container registry functionality
It sets the container it expects beforehand and tests for its ID.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
972e94386c
Let test_setQualityByIdExists use new container registry functionality
It sets the container it expects beforehand and tests for its ID.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
27f053ad7b
Let test_setMaterialByIdExists use new container registry functionality
It sets the container it expects beforehand and tests for its ID.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
361b58f49c
Let container_registry return a pre-set value for what containers it finds
This makes a lot of tests more simple, without requiring elaborate mocks, patches and fixtures.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
8dc073f5c8
Add container types to fallthrough tests
This checks exactly the same code as the global stack.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
b97ef58436
Remove redundant deserialize tests
They test Uranium code, not this module.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
4bb217592f
Refactor deserialise tests
These are now essentially testing the same code as the similar tests for the global stack. This is ugly but without looking at the implementation this is correct.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
2cdb6c5f6f
Split test_constrainContainerTypes into separate tests
Firstly, it'll no longer break on the first assert if multiple things are wrong. Secondly, it can now set different types for each container and put it in the correct slot then.

Contributes to issue CURA-3497.
2017-04-10 12:54:35 +02:00
Ghostkeeper
ccd22ef36d
Add tests for setting property on other parts of extruder stack
It then asks the property back and sees if it was changed.

Contributes to issue CURA-3497.
2017-03-24 17:55:21 +01:00
Ghostkeeper
129f01aa24
Add tests for setting property on user changes of extruder stack
Setting a property directly should put it in the user changes.

Contributes to issue CURA-3497.
2017-03-24 17:52:53 +01:00
Ghostkeeper
fe95755f75
Add tests for setVariantById
One for when the ID exists, and one for when it doesn't.

Contributes to issue CURA-3497.
2017-03-24 17:50:14 +01:00
Ghostkeeper
a5d91139ef
Add tests for setQualityChangesById
One for when the ID exists, and one for when it doesn't.

Contributes to issue CURA-3497.
2017-03-24 17:49:14 +01:00
Ghostkeeper
393ee7838a
Add tests for setQualityById
One for when the ID exists, and one for when it doesn't.

Contributes to issue CURA-3497.
2017-03-24 17:48:27 +01:00
Ghostkeeper
eb7035db45
Add tests for setMaterialById
One for when the ID exists, and one for when it doesn't.

Contributes to issue CURA-3497.
2017-03-24 17:46:59 +01:00
Ghostkeeper
e4952ac8c5
Add tests for setDefinitionById
One for when the ID exists, and one for when it doesn't.

Contributes to issue CURA-3497.
2017-03-24 17:44:22 +01:00
Ghostkeeper
78e78ac147
Add test for settings behaving like a stack
The stack order is very fixed here. Is that bad?

Contributes to issue CURA-3497.
2017-03-24 17:40:41 +01:00
Ghostkeeper
7913ff9bf2
Add test for deserializing with a missing container
A container is missing in the registry, so it should raise an exception.

Contributes to issue CURA-3497.
2017-03-24 17:35:31 +01:00
Ghostkeeper
69c53dcd73
Add test for constraining container types to certain slots
Only the definition slot must hold a definition container. All the rest must hold an instance container. This fails currently because the properties don't even exist.

Contributes to issue CURA-3497.
2017-03-24 17:32:33 +01:00
Ghostkeeper
e3932cb21c
Document deserialize test cases
Contributes to issue CURA-3497.
2017-03-24 17:27:46 +01:00
Ghostkeeper
ccb9c07909
Align parameters of material deserialising test
For readability.

Contributes to issue CURA-3497.
2017-03-24 17:24:35 +01:00
Ghostkeeper
e09f41e485
Add tests for deserialising extruders with definitions
All extruders have definitions, but this one specifically tests whether the ID is correct.

Contributes to issue CURA-3497.
2017-03-24 17:23:56 +01:00
Ghostkeeper
df2ae12ca9
Add tests for deserialising extruders with variants
Contributes to issue CURA-3497.
2017-03-24 17:21:47 +01:00
Ghostkeeper
bbd0ca7b9f
Add tests for deserialising extruders with material
Contributes to issue CURA-3497.
2017-03-24 17:17:41 +01:00
Ghostkeeper
9cb7c30fcb
Add tests for deserialising extruders with quality
Only the greatest extruders with actual quality are deserialised...

Contributes to issue CURA-3497.
2017-03-24 17:13:32 +01:00
Ghostkeeper
71a946d1b9
Add tests for deserialising extruders with quality changes
Contributes to issue CURA-3497.
2017-03-24 17:08:34 +01:00
Ghostkeeper
91814a827b
Line up parameters of test cases
Better oversight.

Contributes to issue CURA-3497.
2017-03-24 17:05:06 +01:00
Ghostkeeper
dea86ca535
Add tests for deserialising a stack with user changes
Code is mostly copied over from the global stack, which should work in a similar way.

Contributes to issue CURA-3497.
2017-03-24 16:57:48 +01:00
Ghostkeeper
e881465050
Add delimiter between global stuff and test cases
Helps provide some oversight since this module is about to explode in size.

Contributes to issue CURA-3497.
2017-03-24 16:31:57 +01:00