33 Commits

Author SHA1 Message Date
Jaime van Kessel
afce462cfa Add test for creation of unique name 2019-02-08 13:35:50 +01:00
Diego Prado Gesto
77c5a94db2 Fix some test in the CuraContainerRegistry.
Delete a test that needs a ContainerProvider. We need to discuss if we
want to add it back, depending if we are still keeping the providers.

Contributes to CURA-5628.
2018-08-14 17:14:30 +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
Lipu Fei
dc52e939e9 Fix unit tests for adding CuraContainerStacks
CURA-5281

Because of the definition_changes fix, CuraContainerStack.deserialize()
may create and add extra containers, so the unit tests need to be adjusted.
2018-04-25 17:55:20 +02:00
Aleksei S
2c18127cc1 Tests: Removed python circular import dependency and added empty containers
CURA-4687
2017-12-15 09:43:02 +01:00
Ghostkeeper
fab85616c7
Remove test for upgrading from legacy stacks to modern stacks
This is because ContainerRegistry.saveAll has been removed. That function was only used by this test. I don't think it's worth keeping this unit test for the effort. It's only for code that's passed through in the version upgrade from 2.4 to 2.5 anyway.

Contributes to issue CURA-4243.
2017-11-27 11:23:24 +01:00
Ghostkeeper
ebe766a7c8
Set definition by their ID
The new function for setting the definition just adds the ID to the metadata.

Contributes to issue CURA-4243.
2017-11-24 16:45:09 +01:00
Ghostkeeper
6c4c7fff4d
Use findContainersMetadata whenever possible
This ensures that we only load those containers that we actually need the data of.

Contributes to issue CURA-4243.
2017-10-20 15:09:45 +02:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Lipu Fei
121ebd79cf Fix circular import problem caused by moving SettingVersion into CuraApplication
CURA-3756
2017-05-16 14:55:34 +02:00
Ghostkeeper
1bac7c2b2a
Don't register registry at ContainerStack class any more
The fixture does this for us automatically now. It's not entirely neat since this is not cleaned up afterwards, but it does make sense to put it there in the fixture, logically.

Contributes to issue CURA-3427.
2017-05-12 16:32:55 +02:00
Ghostkeeper
def93f8dc9
Define fixture for DefinitionContainer instances
Removes a few lines from the tests, making them simpler. Not much though.

Contributes to issue CURA-3427.
2017-05-12 16:31:18 +02:00
Ghostkeeper
a2b0b1076a
Add test for when setting_version doesn't match its definition
Contributes to issue CURA-3427.
2017-05-12 16:28:31 +02:00
Ghostkeeper
2888189f57
Add test for when an instance container has no setting_version
The setting_version is interpreted as 0 then.

Contributes to issue CURA-3427.
2017-05-12 16:25:14 +02:00
Ghostkeeper
52ffac677f
Add test for happy path of filtering by setting_version
If the setting_version is correct, the container should get registered.

Contributes to issue CURA-3427.
2017-05-12 16:21:33 +02:00
Ghostkeeper
ab7b9913c7
Add test for registering global stacks
This test tests adding container stacks and seeing if they convert well.

Contributes to issue CURA-3427.
2017-05-12 16:11:51 +02:00
Ghostkeeper
e50b0884f0
Add test for registring containers
This test tests adding container stacks and seeing if they convert well.

Contributes to issue CURA-3427.
2017-05-12 15:59:38 +02:00
Arjen Hiemstra
51b76acc6d Fix unit test
CuraContainerRegistry::load now has a dependency on the ContainerStack
so we need to account for it in our mocks.
2017-05-04 15:57:47 +02:00
Jaime van Kessel
69c3baf87f Fixed unit test
CURA-3497
2017-05-02 11:06:25 +02:00
Jaime van Kessel
c815077278 Fixed the upgraderFileRename test
CURA-3479
2017-05-01 17:28:55 +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
f579b5f304
Clean up temporary files after test
If the test fails to remove the temporary file, this cleans up after it.

Contributes to issue CURA-3497.
2017-03-23 17:22:10 +01:00
Ghostkeeper
b18c72bbbf
Remove unused import
This was replaced with mocks, if I recall correctly.

Contributes to issue CURA-3497.
2017-03-23 16:48:38 +01:00
Ghostkeeper
053974bc96
Add test to see if legacy files are renamed
The test seems to fail at the moment. No new file is created.

Contributes to issue CURA-3497.
2017-03-23 16:47:37 +01:00
Ghostkeeper
e521f6b38d
Remove unnecessary findContainer replacement
By default the patch context returns mock objects anyway, so no need to actually make a function that does that.

Contributes to issue CURA-3497.
2017-03-23 16:35:11 +01:00
Ghostkeeper
96c7a4ed77
Remove unused variable
This was changed earlier that it doesn't return the same mock every time but creates a new mock in findContainer. So the single mock that used to be returned every time is no longer needed.

Contributes to issue CURA-3497.
2017-03-23 16:16:32 +01:00
Ghostkeeper
60b6b72912
Rename some_material to some_instance
This way we can semantically use it in place of other instances on the stack as well without changing our test.

Contributes to issue CURA-3497.
2017-03-22 15:51:45 +01:00
Ghostkeeper
007f764471
Don't let a test remove files from hard disk
This test does not test the removing of these files. In general, to make a test run fast, it should not perform any disk operations.

Contributes to issue CURA-3497.
2017-03-22 15:47:15 +01:00
Ghostkeeper
49fad35d28
Add test for global stack getting user changes
Tests fail right now because running the test actually deletes files. Got to fix that.

Contributes to issue CURA-3497.
2017-03-22 15:40:13 +01:00
Ghostkeeper
c5768d89dc
Remove debug print
Contributes to issue CURA-3497.
2017-03-22 15:12:46 +01:00
Ghostkeeper
c91765c1ae
Add test for type of loaded container stacks
This tests if container stacks, when loading, get implemented with the correct class: Either an extruder stack or a global stack.

Contributes to issue CURA-3497.
2017-03-22 13:46:14 +01:00