Add alternative scenarios for prepareLocals

Contributes to issue CURA-5929.
This commit is contained in:
Ghostkeeper 2018-11-12 13:42:14 +01:00
parent 91e8c177fe
commit 53c9cdc3fe
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -33,7 +33,7 @@ def test_prepareDefaults(legacy_profile_reader, input):
assert output == {}
test_prepareLocalsData = [
(
( # Ordinary case.
{ # Parser data.
"profile":
{
@ -47,6 +47,56 @@ test_prepareLocalsData = [
"infill_density": "20",
"line_width": "0.4"
}
),
( # Empty data.
{ # Parser data.
"profile":
{
}
},
"profile", # Config section.
{ # Defaults.
}
),
( # All defaults.
{ # Parser data.
"profile":
{
}
},
"profile", # Config section.
{ # Defaults.
"foo": "bar",
"boo": "far"
}
),
( # Multiple config sections.
{ # Parser data.
"some_other_name":
{
"foo": "bar"
},
"profile":
{
"foo": "baz" #Not the same as in some_other_name
}
},
"profile", # Config section.
{ # Defaults.
"foo": "bla"
}
),
( # Section does not exist.
{ # Parser data.
"some_other_name":
{
"foo": "bar"
},
},
"profile", # Config section.
{ # Defaults.
"foo": "baz"
}
)
]