123 Commits

Author SHA1 Message Date
Jaime van Kessel
f585afe77b Fix spacing 2018-09-27 17:31:45 +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
1364370ede Fix global stack tests.
Contributes to CURA-5628.
2018-08-14 13:49:37 +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
dfa870b6a9 Remove approximate diameter unit tests because the function/property is gone 2018-02-27 13:15:03 +01:00
Lipu Fei
f4d69918fb WIP: Remove findDefault..()s 2018-02-16 14:23:11 +01:00
Lipu Fei
12164a0c88 WIP: Remove set..ById()s in CuraContainerStack 2018-02-16 14:23: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
Ghostkeeper
3e278cbd0a
Add test for very large material diameters
Shouldn't matter with Python, but you never know.

Contributes to issue CURA-2822.
2017-06-30 08:47:49 +02:00
Ghostkeeper
adb93507c8
Set material_diameter setting in approximate material diameter test
Instead of the metadata entry, which was a previous implementation of the function. This is essentially just an update of the test.

Contributes to issue CURA-2822.
2017-06-30 08:43:04 +02:00
Ghostkeeper
fc96dfec4e
Expose approximateMaterialDiameter of the definition
This way we can request that from QML.

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Arjen Hiemstra
be08fab97c Fix the addExtruder unit test
Extruders now need to provide a "position" entry.

Contributes to CURA-3738
2017-05-17 13:47:14 +02:00
Jaime van Kessel
06dc1d070e Fixed two remaining failing unit tests
CURA-3738
2017-05-15 11:46:22 +02:00
Jack Ha
209822d0fc Fix unit test. Related to CURA-3757 2017-05-09 12:59:16 +02:00
Jack Ha
8a227c0269 Revert permissions 2017-04-25 11:19:37 +02:00
Jack Ha
74059a82a5 Added some smoketests. CURA-3297 2017-04-25 11:18:55 +02:00
Ghostkeeper
479176bc6f
Remove superfluous mocking and fixtures
There, that's better.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
09ab895feb
Only test whether setProperty calls setProperty on proper container
It sets up a mock container and records whether setProperty is called on that container. Whether that actually sets the property correctly is up to the instance container.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
2161cf9f52
Remove superfluous output_value parameter
It's not used any more since we don't test the actual instance container any more.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
7f1930d452
Rewrite test_setPropertyUser
It now only checks if setProperty is being called on the user changes instance, not what the result of that should be.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
52d6c074f5
Align parameters of test_setPropertyUser
For readability.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
2c9e115488
Add test for hasUserValue returning false
When a value is not in user changes or in quality changes, it is no longer a user value so it shouldn't get marked as one.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
bbddc2308e
Don't use MockContainer in hasUserChanges tests
This makes the testing code much simpler.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
e0c8a52eec
Fix test_setVariantByIdExists
It now also uses the return_value construct.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
f08053283e
Fix test_setQualityChangesByIdExists
It now also uses the return_value construct.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
73bd47a0a1
Actually assert that the ID is correct
Oops.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
c5cce10786
Fix test_setQualityByIdExists
It now also uses the return_value construct.

Contributes to issue CURA-3497.
2017-04-12 10:00:44 +02:00
Ghostkeeper
d652e4564e
Fix test_setMaterialByIdExists
It now also uses the return_value construct.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
546cacec37
Verify that we set the correct container after set...ByID
Makes sense.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
6ba79881df
Use new container registry functionality for test_setDefinitionByIdExists
We can just set the return value of the registry to whatever we like and we'll verify that we got that from the registry and it was put on the stack.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
4f83ae3fa7
Remove unused import
It was removed when we removed some of the mocking code earlier.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Ghostkeeper
c3ad7d114a
Set return value of registry.findContainers in the test
This way we need to mock way less. It's the min-cut.

Contributes to issue CURA-3497.
2017-04-12 10:00:43 +02:00
Arjen Hiemstra
93e42164a8 Make value unit tests also provide a "state" property
Since we now use state to determine whether we should perform resolve or
not.
2017-04-11 13:56:40 +02:00
Ghostkeeper
70dc9fd95b
Document why we skip this test for now
Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Ghostkeeper
1c2ce5b8b1
Remove old getPropertyWithResolve test
It has been replaced by several separate tests right above it.

Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Ghostkeeper
86b288cc6e
Add test for when instances have value and definition has resolve
The value of the instances should always get evaluated first.

Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Ghostkeeper
759da2ab05
Add test for value winning over resolve in instances
In instance containers, if there's both a resolve and a value, it should take the value.

Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Ghostkeeper
0a7bcc4277
Add test for when there's no resolve in definitions
It must not attempt to execute a resolve function then.

Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Ghostkeeper
12d1db8f19
Add test for whether resolve wins in definition
I'm splitting the test below up into pieces. It'll be removed eventually, when I've made all of these separate tests.

Contributes to issue CURA-3497.
2017-04-11 10:42:17 +02:00
Arjen Hiemstra
73779eef25 Properly set the ContainerRegistry for the missing container test 2017-04-10 18:06:24 +02:00
Ghostkeeper
dfd8cfb2b8
Skip test_deserializeMoveDefinitionContainer
This test is currently failing because of a weird hack we're doing to get around a Uranium bug: We're searching only through definitions that have a category, any category. This is done because Uranium requires a search to have some metadata entry to search on. We'll have to refactor that eventually but for now that is out of scope.

Contributes to issue CURA-3497.
2017-04-10 17:17:13 +02:00
Ghostkeeper
71aca6aa4b
Remove old deserialize tests
Most of these tests also tested the Uranium code, which it should mock out. The last test, test_deserializeMissingContainer, is caught by the currently existing tests.

Contributes to issue CURA-3497.
2017-04-10 17:14:50 +02:00
Ghostkeeper
f12ffad2c1
Add test for moving definition containers
When a definition container is in the wrong spot in a stack file it needs to be moved to the definition slot.

Contributes to issue CURA-3497.
2017-04-10 17:12:27 +02:00
Ghostkeeper
e807739117
Add test for moving containers through deserialising
When a container in the stack file is located in the wrong spot, it needs to move the container to the correct spot.

Contributes to issue CURA-3497.
2017-04-10 17:08:23 +02:00
Ghostkeeper
f27e7fca88
Document test_deserializeWrongDefinitionClass
Contributes to issue CURA-3497.
2017-04-10 16:46:47 +02:00