Arjen Hiemstra
3c1cbd5aa9
Do not compare string to actual type
...
As far as we know, Global or Container stack should not take care of
string -> value conversion
2017-03-28 18:18:29 +02:00
Arjen Hiemstra
3620ce4c0a
Fix setPropertyUser test with the right container and parameter order of setProperty
2017-03-28 18:17:12 +02:00
Arjen Hiemstra
87ce6246d8
Introduce a "writable global stack" fixture
...
This one has MockContainers set for all containers that allow calling
setProperty
2017-03-28 18:16:00 +02:00
Arjen Hiemstra
dc84141714
Implement set/getProperty for MockContainer
...
Otherwise setProperty/getProperty tests will never work
2017-03-28 17:51:46 +02:00
Arjen Hiemstra
7175ac0d20
Do not try to perform a setProperty on a definition
...
That is never going to work
2017-03-28 17:50:37 +02:00
Arjen Hiemstra
2a2df31c5b
Set the User container to a writable container in testSetProperty
...
Since empty container (the default) will not allow writes
2017-03-28 17:50:09 +02:00
Arjen Hiemstra
3f1f4a172d
Fix constrainContainerTypes test
...
We do not allow random containers to be assigned to specific properties,
only the containers that specify they are of a certain type.
2017-03-28 17:48:55 +02:00
Arjen Hiemstra
593c6c0c8f
Set and clear ContainerStack's _containerRegistry property
2017-03-28 17:47:10 +02:00
Arjen Hiemstra
8f36e76588
Make sure to use the right metadata type entry for mock containers
2017-03-27 17:57:07 +02:00
Arjen Hiemstra
60ee1a3f75
We also raise InvalidContainer when setting variant
2017-03-27 17:56:46 +02:00
Arjen Hiemstra
5892f13349
Fix naming of definitionChanges property in test
2017-03-27 17:55:44 +02:00
Arjen Hiemstra
da751fa0ea
We raise InvalidContainerError, not KeyError when a container was not found
2017-03-27 17:55:24 +02:00
Arjen Hiemstra
270cdd08cb
Don't modify ContainerStack._containerRegistry property
...
We do not use it in GlobalStack
2017-03-27 17:54:44 +02:00
Arjen Hiemstra
385d8ac5b5
Properly mock Container and ContainerRegistry objects in Global stack test
2017-03-27 17:53:30 +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
2936b9bf24
Fail deserialize test if missing container doesn't raise an exception
...
If it raised an exception, we were checking whether it was the proper exception. But if it wasn't raising an exception we weren't checking anything. That's fixed now (and the header of the function is improved a bit too).
Contributes to issue CURA-3497.
2017-03-24 17:37:23 +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
73326ae53d
Extruders don't have definition changes
...
So remove them from our test extruder stacks.
Contributes to issue CURA-3497.
2017-03-24 17:03:29 +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
Ghostkeeper
14ac41e58f
Add tests for setQualityChangesById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 16:24:27 +01:00
Ghostkeeper
498956a190
Add tests for setQualityById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 16:19:47 +01:00
Ghostkeeper
d9ba848dc8
Add tests for setMeterialById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 16:15:50 +01:00
Ghostkeeper
3e437074ae
Sort tests better
...
Alphabetically.
Contributes to issue CURA-3497.
2017-03-24 16:01:56 +01:00
Ghostkeeper
dbc4a90e10
Add tests for setDefinitionChangesById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 16:00:55 +01:00
Ghostkeeper
928181507d
Add tests for setDefinitionById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 15:58:32 +01:00
Ghostkeeper
f29d5e897c
Add tests for setVariantById
...
One for when the ID exists, one for when it doesn't exist.
Contributes to issue CURA-3497.
2017-03-24 15:55:01 +01:00
Ghostkeeper
72bbb8ec0c
Also test whether adding an extruder had any effect on the extruder list
...
Contributes to issue CURA-3497.
2017-03-24 15:46:29 +01:00
Ghostkeeper
55dd17cae7
Add tests for changing properties on specified containers
...
Other than just user, that is.
Contributes to issue CURA-3497.
2017-03-24 15:42:05 +01:00
Ghostkeeper
319fd929d8
Add test for setProperty to set properties on user changes
...
Contributes to issue CURA-3497.
2017-03-24 15:34:31 +01:00
Ghostkeeper
eeb84ac27b
Add tests for prohibited operations on extruder stacks
...
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497.
2017-03-24 15:11:25 +01:00
Ghostkeeper
3d7dbe2e3b
Expand constrainContainerTypes test with subclasses of container types
...
Subclasses should behave in the same way as their parents.
Contributes to issue CURA-3497.
2017-03-24 14:50:57 +01:00
Ghostkeeper
00c1c2dcf6
Add test to verify that you can't change types of containers
...
For instance, you shouldn't be able to put an instance container in the definition slot.
Contributes to issue CURA-3497.
2017-03-24 14:40:32 +01:00
Ghostkeeper
d1dc48d7e1
Add test to verify priority of resolve property
...
The resolve property should get priority over the value in the definition container, but not anywhere else.
Contributes to issue CURA-3497.
2017-03-24 14:27:30 +01:00