mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Add test for prepareDefaults
Contributes to issue CURA-5929.
This commit is contained in:
parent
6d1b64465a
commit
bbbb08c793
1 changed files with 31 additions and 0 deletions
31
plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py
Normal file
31
plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import pytest #To register tests with.
|
||||||
|
|
||||||
|
from LegacyProfileReader import LegacyProfileReader #The module we're testing.
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def legacy_profile_reader():
|
||||||
|
return LegacyProfileReader()
|
||||||
|
|
||||||
|
test_prepareDefaultsData = [
|
||||||
|
{
|
||||||
|
"defaults": {
|
||||||
|
"foo": "bar"
|
||||||
|
},
|
||||||
|
"cheese": "delicious"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cat": "fluffy",
|
||||||
|
"dog": "floofy"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("input", test_prepareDefaultsData)
|
||||||
|
def test_prepareDefaults(legacy_profile_reader, input):
|
||||||
|
output = legacy_profile_reader.prepareDefaults(input)
|
||||||
|
if "defaults" in input:
|
||||||
|
assert input["defaults"] == output
|
||||||
|
else:
|
||||||
|
assert output == {}
|
Loading…
Add table
Add a link
Reference in a new issue