diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-02-15 00:00:00 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-02-16 16:23:11 +0300 |
commit | 12164a0c888e251911ed81e9595d56215dd09d80 (patch) | |
tree | d835413dd0a532746e7711bc463dee15092186c3 /tests | |
parent | 4af176dbf39a58fd59b8a613ba64407df3313204 (diff) |
WIP: Remove set..ById()s in CuraContainerStack
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Settings/TestExtruderStack.py | 59 | ||||
-rwxr-xr-x | tests/Settings/TestGlobalStack.py | 72 |
2 files changed, 0 insertions, 131 deletions
diff --git a/tests/Settings/TestExtruderStack.py b/tests/Settings/TestExtruderStack.py index e1538cd3fc..ce829da4b3 100644 --- a/tests/Settings/TestExtruderStack.py +++ b/tests/Settings/TestExtruderStack.py @@ -325,30 +325,6 @@ def test_removeContainer(extruder_stack): with pytest.raises(InvalidOperationError): extruder_stack.removeContainer(unittest.mock.MagicMock()) -## Tests setting definitions by specifying an ID of a definition that exists. -def test_setDefinitionByIdExists(extruder_stack, container_registry): - container_registry.return_value = DefinitionContainer(container_id = "some_definition") - extruder_stack.setDefinitionById("some_definition") - assert extruder_stack.definition.getId() == "some_definition" - -## Tests setting definitions by specifying an ID of a definition that doesn't -# exist. -def test_setDefinitionByIdDoesntExist(extruder_stack): - with pytest.raises(InvalidContainerError): - extruder_stack.setDefinitionById("some_definition") #Container registry is empty now. - -## Tests setting materials by specifying an ID of a material that exists. -def test_setMaterialByIdExists(extruder_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "material") - extruder_stack.setMaterialById("InstanceContainer") - assert extruder_stack.material.getId() == "InstanceContainer" - -## Tests setting materials by specifying an ID of a material that doesn't -# exist. -def test_setMaterialByIdDoesntExist(extruder_stack): - with pytest.raises(InvalidContainerError): - extruder_stack.setMaterialById("some_material") #Container registry is empty now. - ## Tests setting properties directly on the extruder stack. @pytest.mark.parametrize("key, property, value", [ ("layer_height", "value", 0.1337), @@ -387,38 +363,3 @@ def test_setPropertyOtherContainers(target_container, stack_variable, extruder_s extruder_stack.setProperty(key, property, value, target_container = target_container) #The actual test. getattr(extruder_stack, stack_variable).setProperty.assert_called_once_with(key, property, value) #Make sure that the proper container gets a setProperty call. - -## Tests setting qualities by specifying an ID of a quality that exists. -def test_setQualityByIdExists(extruder_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "quality") - extruder_stack.setQualityById("InstanceContainer") - assert extruder_stack.quality.getId() == "InstanceContainer" - -## Tests setting qualities by specifying an ID of a quality that doesn't exist. -def test_setQualityByIdDoesntExist(extruder_stack): - with pytest.raises(InvalidContainerError): - extruder_stack.setQualityById("some_quality") #Container registry is empty now. - -## Tests setting quality changes by specifying an ID of a quality change that -# exists. -def test_setQualityChangesByIdExists(extruder_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "quality_changes") - extruder_stack.setQualityChangesById("InstanceContainer") - assert extruder_stack.qualityChanges.getId() == "InstanceContainer" - -## Tests setting quality changes by specifying an ID of a quality change that -# doesn't exist. -def test_setQualityChangesByIdDoesntExist(extruder_stack): - with pytest.raises(InvalidContainerError): - extruder_stack.setQualityChangesById("some_quality_changes") #Container registry is empty now. - -## Tests setting variants by specifying an ID of a variant that exists. -def test_setVariantByIdExists(extruder_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "variant") - extruder_stack.setVariantById("InstanceContainer") - assert extruder_stack.variant.getId() == "InstanceContainer" - -## Tests setting variants by specifying an ID of a variant that doesn't exist. -def test_setVariantByIdDoesntExist(extruder_stack): - with pytest.raises(InvalidContainerError): - extruder_stack.setVariantById("some_variant") #Container registry is empty now. diff --git a/tests/Settings/TestGlobalStack.py b/tests/Settings/TestGlobalStack.py index 9b0735c8f2..dc786b2df4 100755 --- a/tests/Settings/TestGlobalStack.py +++ b/tests/Settings/TestGlobalStack.py @@ -486,43 +486,6 @@ def test_removeContainer(global_stack): with pytest.raises(InvalidOperationError): global_stack.removeContainer(unittest.mock.MagicMock()) -## Tests setting definitions by specifying an ID of a definition that exists. -def test_setDefinitionByIdExists(global_stack, container_registry): - container_registry.return_value = DefinitionContainer(container_id = "some_definition") - global_stack.setDefinitionById("some_definition") - assert global_stack.definition.getId() == "some_definition" - -## Tests setting definitions by specifying an ID of a definition that doesn't -# exist. -def test_setDefinitionByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setDefinitionById("some_definition") #Container registry is empty now. - -## Tests setting definition changes by specifying an ID of a container that -# exists. -def test_setDefinitionChangesByIdExists(global_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "definition_changes") - global_stack.setDefinitionChangesById("InstanceContainer") - assert global_stack.definitionChanges.getId() == "InstanceContainer" - -## Tests setting definition changes by specifying an ID of a container that -# doesn't exist. -def test_setDefinitionChangesByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setDefinitionChangesById("some_definition_changes") #Container registry is empty now. - -## Tests setting materials by specifying an ID of a material that exists. -def test_setMaterialByIdExists(global_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "material") - global_stack.setMaterialById("InstanceContainer") - assert global_stack.material.getId() == "InstanceContainer" - -## Tests setting materials by specifying an ID of a material that doesn't -# exist. -def test_setMaterialByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setMaterialById("some_material") #Container registry is empty now. - ## Tests whether changing the next stack is properly forbidden. def test_setNextStack(global_stack): with pytest.raises(InvalidOperationError): @@ -568,41 +531,6 @@ def test_setPropertyOtherContainers(target_container, stack_variable, global_sta getattr(global_stack, stack_variable).setProperty.assert_called_once_with(key, property, value) #Make sure that the proper container gets a setProperty call. -## Tests setting qualities by specifying an ID of a quality that exists. -def test_setQualityByIdExists(global_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "quality") - global_stack.setQualityById("InstanceContainer") - assert global_stack.quality.getId() == "InstanceContainer" - -## Tests setting qualities by specifying an ID of a quality that doesn't exist. -def test_setQualityByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setQualityById("some_quality") #Container registry is empty now. - -## Tests setting quality changes by specifying an ID of a quality change that -# exists. -def test_setQualityChangesByIdExists(global_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "quality_changes") - global_stack.setQualityChangesById("InstanceContainer") - assert global_stack.qualityChanges.getId() == "InstanceContainer" - -## Tests setting quality changes by specifying an ID of a quality change that -# doesn't exist. -def test_setQualityChangesByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setQualityChangesById("some_quality_changes") #Container registry is empty now. - -## Tests setting variants by specifying an ID of a variant that exists. -def test_setVariantByIdExists(global_stack, container_registry): - container_registry.return_value = getInstanceContainer(container_type = "variant") - global_stack.setVariantById("InstanceContainer") - assert global_stack.variant.getId() == "InstanceContainer" - -## Tests setting variants by specifying an ID of a variant that doesn't exist. -def test_setVariantByIdDoesntExist(global_stack): - with pytest.raises(InvalidContainerError): - global_stack.setVariantById("some_variant") #Container registry is empty now. - ## Smoke test for findDefaultVariant def test_smoke_findDefaultVariant(global_stack): global_stack.findDefaultVariant() |