From 06797abafe58dbb7b84d3801429820c0041caa76 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 12 Apr 2017 09:51:16 +0200 Subject: [PATCH] Change expected exception in test_set...ByIdDoesntExist It should raise an InvalidContainerError rather than a KeyError. Contributes to issue CURA-3497. --- tests/Settings/TestExtruderStack.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/Settings/TestExtruderStack.py b/tests/Settings/TestExtruderStack.py index db3b1a6716..8560a3e354 100644 --- a/tests/Settings/TestExtruderStack.py +++ b/tests/Settings/TestExtruderStack.py @@ -315,9 +315,8 @@ def test_setDefinitionByIdExists(extruder_stack, container_registry): ## Tests setting definitions by specifying an ID of a definition that doesn't # exist. -@pytest.mark.skip def test_setDefinitionByIdDoesntExist(extruder_stack): - with pytest.raises(KeyError): + 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. @@ -328,9 +327,8 @@ def test_setMaterialByIdExists(extruder_stack, container_registry): ## Tests setting materials by specifying an ID of a material that doesn't # exist. -@pytest.mark.skip def test_setMaterialByIdDoesntExist(extruder_stack): - with pytest.raises(KeyError): + with pytest.raises(InvalidContainerError): extruder_stack.setMaterialById("some_material") #Container registry is empty now. ## Tests setting properties directly on the extruder stack. @@ -382,9 +380,8 @@ def test_setQualityByIdExists(extruder_stack, container_registry): assert extruder_stack.quality.getId() == "InstanceContainer" ## Tests setting qualities by specifying an ID of a quality that doesn't exist. -@pytest.mark.skip def test_setQualityByIdDoesntExist(extruder_stack): - with pytest.raises(KeyError): + 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 @@ -396,9 +393,8 @@ def test_setQualityChangesByIdExists(extruder_stack, container_registry): ## Tests setting quality changes by specifying an ID of a quality change that # doesn't exist. -@pytest.mark.skip def test_setQualityChangesByIdDoesntExist(extruder_stack): - with pytest.raises(KeyError): + 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. @@ -408,7 +404,6 @@ def test_setVariantByIdExists(extruder_stack, container_registry): assert extruder_stack.variant.getId() == "InstanceContainer" ## Tests setting variants by specifying an ID of a variant that doesn't exist. -@pytest.mark.skip def test_setVariantByIdDoesntExist(extruder_stack): - with pytest.raises(KeyError): + with pytest.raises(InvalidContainerError): extruder_stack.setVariantById("some_variant") #Container registry is empty now. \ No newline at end of file