Skip to content

Commit

Permalink
new testcase: 'Puma Prime' for key 'notes' (also added type check for…
Browse files Browse the repository at this point in the history
… 'base_chassis_heat_sinks')
  • Loading branch information
juk0de committed Sep 30, 2024
1 parent 32f40b1 commit 75d9d50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/json/biped/Puma_(Adder)_Prime.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,6 @@
"communications": "945B",
"targeting": "V8.6"
}
}
},
"notes": "Codenamed Puma by Inner Sphere forces who first engaged it."
}
6 changes: 4 additions & 2 deletions tests/test_generic_biped.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ def check_str_value(value: str, expected_value: str) -> None:
# check for fluff in all files that contain some
if json_data["chassis"] not in ["Vixen"] and json_data["model"] not in ["SHD-5S"]:
check_keys(json_data, ["fluff"])
# Puma Prime has keys "base_chassis_heat_sinks" and "clannname"
# Puma Prime has keys "base_chassis_heat_sinks", "clannname" and "notes"
if json_data["chassis"] == "Puma" and json_data["model"] == "Prime":
check_keys(json_data, ["clanname"])
check_keys(json_data, ["clanname", "notes"])
check_type(json_data["clanname"], str)
check_type(json_data["notes"], str)
check_keys(
json_data["heat_sinks"], ["base_chassis_heat_sinks", "quantity", "type"]
)
check_type(json_data["heat_sinks"]["base_chassis_heat_sinks"], int)
# Wolfhound contains the 'ejection' key
if json_data["chassis"] == "Wolfhound":
check_keys(json_data, ["ejection"])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_specific_biped.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def compare_dicts(d1: Dict[str, Any], d2: Dict[str, Any], path: str = "") -> Non
# - empty 'model' value
# - no quirks
# - multiple weapon quirks with identical weapon names
# Puma_(Adder)_Prime.mtf: contains keys 'clanname' and 'base_chassis_heat_sinks'
# Puma_(Adder)_Prime.mtf: contains keys 'clanname', 'base_chassis_heat_sinks' and 'notes'
# Wolfhound_WLF-1A: contains the 'ejection' key
@pytest.mark.parametrize(
"mtf_file, json_file",
Expand Down

0 comments on commit 75d9d50

Please sign in to comment.