Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2019-09-06 18:26:28 +0300
committerJaime van Kessel <nallath@gmail.com>2019-09-06 18:26:28 +0300
commit6f92537305e60360643f3dee42194f59d0292029 (patch)
tree832f39fa300edf87f0ef2c277154a933ff74aeaa /plugins/XmlMaterialProfile
parent09025edffab2f382e7a7587955f1b6d5fcd25550 (diff)
Add unhappy test for serializing nonbase material
Diffstat (limited to 'plugins/XmlMaterialProfile')
-rw-r--r--plugins/XmlMaterialProfile/tests/TestXmlMaterialProfile.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/XmlMaterialProfile/tests/TestXmlMaterialProfile.py b/plugins/XmlMaterialProfile/tests/TestXmlMaterialProfile.py
index 9658328c8a..e794117946 100644
--- a/plugins/XmlMaterialProfile/tests/TestXmlMaterialProfile.py
+++ b/plugins/XmlMaterialProfile/tests/TestXmlMaterialProfile.py
@@ -62,4 +62,19 @@ def test_setDirty():
material_1.setDirty(False)
assert not material_1.isDirty()
- assert material_2.isDirty() \ No newline at end of file
+ assert material_2.isDirty()
+
+
+def test_serializeNonBaseMaterial():
+ material_1 = createXmlMaterialProfile("herpderp")
+ material_1.getMetaData()["base_file"] = "omgzomg"
+
+ container_registry = MagicMock()
+ container_registry.isReadOnly = MagicMock(return_value=False)
+ container_registry.findContainers = MagicMock(return_value=[material_1])
+
+ with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value=container_registry)):
+ with pytest.raises(NotImplementedError):
+ # This material is not a base material, so it can't be serialized!
+ material_1.serialize()
+ \ No newline at end of file