add tss tournament stuff (#1349)

This commit is contained in:
NotSoToothless
2026-06-20 21:56:03 -07:00
committed by GitHub
parent da66722e03
commit f2a1a33c28
2 changed files with 37 additions and 0 deletions
+16
View File
@@ -79,6 +79,22 @@ def test_normalize_side():
assert tt.normalize_side("Group") == "group"
def test_apply_tournament_side_context_moves_double_elim_semifinal_to_loser():
matches = [
{"type_bracket": "Winner", "side": "winner"},
{"type_bracket": "Looser", "side": "loser"},
{"type_bracket": "Semifinal", "side": "final"},
{"type_bracket": "Final", "side": "final"},
]
tt.apply_tournament_side_context(matches)
assert matches[2]["side"] == "loser"
assert matches[3]["side"] == "final"
single_elim = [{"type_bracket": "Semifinal", "side": "final"}]
tt.apply_tournament_side_context(single_elim)
assert single_elim[0]["side"] == "final"
def test_derive_format():
assert tt.derive_format([], "double-elumination") == "double-elim"
assert tt.derive_format([], "single-elumination") == "single-elim"