@@ -0,0 +1,1227 @@
+# Copyright (c) 2017 Ultimaker B.V.%0A# Cura is released under the terms of the AGPLv3 or higher.%0A%0Aimport pytest #This module contains automated tests.%0Aimport unittest.mock #For the mocking and monkeypatching functionality.%0A%0Aimport cura.Settings.ExtruderStack #The module we're testing.%0Afrom cura.Settings.Exceptions import InvalidOperationError #To check whether the correct exceptions are raised.%0A%0A##  An empty extruder stack to test with.%0A@pytest.fixture()%0Adef extruder_stack() -%3E cura.Settings.ExtruderStack.ExtruderStack:%0A    return cura.Settings.ExtruderStack.ExtruderStack%0A%0A##  Tests whether adding a container is properly forbidden.%0Adef test_addContainer(extruder_stack):%0A    with pytest.raises(InvalidOperationError):%0A        extruder_stack.addContainer(unittest.mock.MagicMock())%0A%0A##  Tests whether inserting a container is properly forbidden.%0Adef test_insertContainer(extruder_stack):%0A    with pytest.raises(InvalidOperationError):%0A        extruder_stack.insertContainer(0, unittest.mock.MagicMock())%0A%0A##  Tests whether removing a container is properly forbidden.%0Adef test_removeContainer(extruder_stack):%0A    with pytest.raises(InvalidOperationError):%0A        extruder_stack.removeContainer(unittest.mock.MagicMock())

Add tests for prohibited operations on extruder stacks