update for spectra changes (#1363)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user