mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 20:13:56 -06:00
Add unhappy test for serializing nonbase material
This commit is contained in:
parent
09025edffa
commit
6f92537305
1 changed files with 16 additions and 1 deletions
|
@ -62,4 +62,19 @@ def test_setDirty():
|
||||||
material_1.setDirty(False)
|
material_1.setDirty(False)
|
||||||
|
|
||||||
assert not material_1.isDirty()
|
assert not material_1.isDirty()
|
||||||
assert material_2.isDirty()
|
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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue