Also assert that the extruder_nr setting matches

This commit is contained in:
Ghostkeeper 2019-11-01 15:08:09 +01:00
parent d145945b25
commit 1f4c863683
No known key found for this signature in database
GPG key ID: 59A4C0959592C05C

View file

@ -169,4 +169,9 @@ def test_extruderMatch(file_path: str):
assert "machine_extruder_trains" in machine_doc["metadata"], "Machine must define extruder trains."
extruder_trains = machine_doc["metadata"]["machine_extruder_trains"]
assert position in extruder_trains, "There must be a reference to the extruder in the machine definition."
assert extruder_trains[position] == extruder_id, "The extruder referenced in the machine definition must match up."
assert extruder_trains[position] == extruder_id, "The extruder referenced in the machine definition must match up."
# Also test if the extruder_nr setting is properly overridden.
if "overrides" not in doc or "extruder_nr" not in doc["overrides"] or "default_value" not in doc["overrides"]["extruder_nr"]:
assert position == "0" # Default to 0 is allowed.
assert doc["overrides"]["extruder_nr"]["default_value"] == int(position)