update for spectra changes (#1363)

This commit is contained in:
NotSoToothless
2026-06-29 11:05:51 -07:00
committed by GitHub
parent fa203c653b
commit 6d251be97c
4 changed files with 79 additions and 16 deletions
+26
View File
@@ -29,3 +29,29 @@ def test_model_carries_tournament_id():
model = build_scoreboard_model(_game())
assert model is not None
assert model["tournament_id"] == 24965
def test_model_strips_unit_model_prefixes_for_dead_matching():
game = _game()
game["players"]["2"]["units"][0]["unit"] = "tankModels/pz"
game["players"]["2"]["units"][0]["unit_type"] = "tank"
game["players"]["2"]["units"][0]["unit_class"] = "medium tank"
game["players"]["2"]["country"] = "germany"
game["events"] = {
"kills": [
{
"offended_uid": "2",
"offended_unit": "tankModels/pz",
}
]
}
model = build_scoreboard_model(game)
assert model is not None
bob = model["teams"][1]["players"][0]
assert bob["country"] == "germany"
assert bob["units"][0]["internal"] == "pz"
assert bob["units"][0]["dead"] is True
assert bob["units"][0]["unit_type"] == "tank"
assert bob["units"][0]["unit_class"] == "medium tank"