возможно теперь загружается матч через интернет, но не точно

This commit is contained in:
2026-08-19 15:53:18 +03:00
parent 915be04057
commit ed9889439a
5 changed files with 102 additions and 21 deletions

View File

@@ -0,0 +1,25 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
JS = (ROOT / "hockey_data" / "static" / "tournament-menu.js").read_text(encoding="utf-8")
ROUTER = (ROOT / "hockey_data" / "router.py").read_text(encoding="utf-8")
def test_account_switch_clears_account_bound_runtime_state():
assert 'account: "hockey.accountId"' in JS
assert 'previousAccountId !== currentAccountId' in JS
assert 'localStorage.removeItem(storage.session)' in JS
assert 'localStorage.removeItem(storage.game)' in JS
assert 'localStorage.removeItem(storage.vmixDevice)' in JS
assert 'await ensureAccountScopedRuntimeState();' in JS
def test_match_session_retries_without_stale_agent():
assert 'const selectedDeviceId = currentAgentDeviceId();' in JS
assert 'Retry the operator session without Agent' in JS
assert 'JSON.stringify({ ...sessionPayload, vmix_device_id: "" })' in JS
def test_agent_assignment_cannot_break_operator_session_creation():
assert 'result["agent_warning"] = str(agent_error)[:300]' in ROUTER
assert 'result["agent_assignment"] = None' in ROUTER