Files
TSSBOT/tests/test_tss_api_tournaments.py
T
NotSoToothless 24335a2677 Auto merge dev → main (#1353)
* feat(gateway): hashed key store with grant + hot reload

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): channel registry + aiohttp app (keyed auth, whoami, per-channel ws/proxy)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): manage_keys CLI (add/list/revoke)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): retire srebot_external, run relay-gateway under PM2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): point ecosystem + README at relay-gateway

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss): replay outbox producer for relay gateway

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss): forward processed games to relay outbox

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): db helpers, app skeleton, info endpoint, fixtures

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): player, games, history, search endpoints

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): live, match, scoreboard, matches-search, maps

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): filter-required leaderboards (players/vehicles/stats)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): tournament list/detail/standings/matches

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat: wire tss upstream through gateway + tssbot-api PM2 app

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 03:38:20 -07:00

29 lines
925 B
Python

def test_list_tournaments(client):
r = client.get("/api/tss/tournaments")
assert r.json()["tournaments"][0]["tournament_id"] == 24839
def test_tournament_detail(client):
r = client.get("/api/tss/tournament/24839")
body = r.json()
assert body["tournament"]["name"] == "Cadet 1x1 RB Air"
assert body["standings"][0]["team_name"] == "BenisPutt"
assert len(body["matches"]) == 1
def test_tournament_unknown_404(client):
assert client.get("/api/tss/tournament/999").status_code == 404
def test_tournament_matches_coerce_empty_to_null(client):
r = client.get("/api/tss/tournament/24839/matches")
m = r.json()["matches"][0]
assert m["round"] is None
assert m["position"] is None
assert m["session_ids"] == ["6cbc20b001de1ee"]
def test_tournament_standings(client):
r = client.get("/api/tss/tournament/24839/standings")
assert r.json()["standings"][0]["rank"] == 1