mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:48:58 +08:00
Add tests for _isMetadataValid
This commit is contained in:
parent
c841382bbd
commit
c7ab1a9f5d
@ -12,7 +12,7 @@ from cura.Settings.GlobalStack import GlobalStack #Testing for returning the cor
|
|||||||
import UM.Settings.InstanceContainer #Creating instance containers to register.
|
import UM.Settings.InstanceContainer #Creating instance containers to register.
|
||||||
import UM.Settings.ContainerRegistry #Making empty container stacks.
|
import UM.Settings.ContainerRegistry #Making empty container stacks.
|
||||||
import UM.Settings.ContainerStack #Setting the container registry here properly.
|
import UM.Settings.ContainerStack #Setting the container registry here properly.
|
||||||
|
import cura.CuraApplication
|
||||||
|
|
||||||
def teardown():
|
def teardown():
|
||||||
#If the temporary file for the legacy file rename test still exists, remove it.
|
#If the temporary file for the legacy file rename test still exists, remove it.
|
||||||
@ -300,3 +300,11 @@ class TestImportProfile:
|
|||||||
with unittest.mock.patch.object(container_registry, "_configureProfile", return_value=None):
|
with unittest.mock.patch.object(container_registry, "_configureProfile", return_value=None):
|
||||||
result = container_registry.importProfile("test.zomg")
|
result = container_registry.importProfile("test.zomg")
|
||||||
assert result["status"] == "ok"
|
assert result["status"] == "ok"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("metadata,result", [(None, False),
|
||||||
|
({}, False),
|
||||||
|
({"setting_version": cura.CuraApplication.CuraApplication.SettingVersion}, True),
|
||||||
|
({"setting_version": 0}, False)])
|
||||||
|
def test_isMetaDataValid(container_registry, metadata, result):
|
||||||
|
assert container_registry._isMetadataValid(metadata) == result
|
Loading…
x
Reference in New Issue
Block a user