From e2efa060f9c99c03a4cc356dfeadfd1bc931fcdb Mon Sep 17 00:00:00 2001 From: db9979 Date: Sun, 27 Sep 2026 05:49:07 +0200 Subject: [PATCH] Tests: hand-built session mocks carry the observer flag Browser probes that fake the session body must match the v2 session schema, which now has the observer field (phase 12). Co-Authored-By: Claude Fable 5.1 --- tests/test_commander_browser_sessions_v2.py | 4 ++-- tests/test_commander_layout.py | 2 +- tests/test_web_simlog_browser.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_commander_browser_sessions_v2.py b/tests/test_commander_browser_sessions_v2.py index 39f268ad..cd57ed95 100644 --- a/tests/test_commander_browser_sessions_v2.py +++ b/tests/test_commander_browser_sessions_v2.py @@ -1018,7 +1018,7 @@ def test_direct_fire_grants_confirmation_exact_bodies_and_role_switch_in_chromiu direct_fire=station in {"opz", "helicopter"}) session = dict(protocol=2, client_id="fire-client", name="Fire Watch", csrf="fire-csrf", ordinal=0, presence=1.0, host=None, - next_command_seq=0, station="weapons", requested_station=None, + next_command_seq=0, observer=False, station="weapons", requested_station=None, station_generation=1, active_station="weapons", active_generation=1, simlog=False, stations=stations, grants=dict(command=True, direct_fire=False, simlog=False, @@ -1323,7 +1323,7 @@ def test_v2_lobby_requests_grants_release_reload_and_role_loss_in_real_chromium( if self.path == "/api/v2/pair" and body == {"code": "123ABC", "name": "Lobby Watch"}: cls.session = {"protocol": 2, "client_id": "client-1", "name": "Lobby Watch", "csrf": "csrf-1", "ordinal": 0, "presence": 1.0, - "next_command_seq": 0, "active_station": None, + "next_command_seq": 0, "observer": False, "active_station": None, "active_generation": 0, "simlog": False, "host": None, "station": None, "requested_station": None, "station_generation": 0, diff --git a/tests/test_commander_layout.py b/tests/test_commander_layout.py index d9ea7f47..7370d9a7 100644 --- a/tests/test_commander_layout.py +++ b/tests/test_commander_layout.py @@ -315,7 +315,7 @@ def test_v2_lobby_layout_is_bounded(tmp_path, width, height, zoom, language): empty_grants = {"command": False, "direct_fire": False, "sonar_audio": False} session = {"protocol": 2, "client_id": "layout-client", "name": "Layout Lobby", "csrf": "layout-csrf", "ordinal": 0, "presence": 1.0, - "next_command_seq": 0, "active_station": None, + "next_command_seq": 0, "observer": False, "active_station": None, "active_generation": 0, "simlog": False, "host": None, "station": None, "requested_station": None, "station_generation": 0, "stations": { diff --git a/tests/test_web_simlog_browser.py b/tests/test_web_simlog_browser.py index e6de964d..f16d6ebf 100644 --- a/tests/test_web_simlog_browser.py +++ b/tests/test_web_simlog_browser.py @@ -99,7 +99,7 @@ def test_web_simlog_shows_all_projected_values_and_a_map_in_chromium(tmp_path): stations = {station: _station_record() for station in STATIONS} stations["opz"] = _station_record("mine", station_generation=1, command=True) session = dict(protocol=2, client_id="log-client", name="Log Watch", - csrf="log-csrf", ordinal=0, presence=1.0, next_command_seq=0, host=None, + csrf="log-csrf", ordinal=0, presence=1.0, next_command_seq=0, host=None, observer=False, station="opz", requested_station=None, station_generation=1, active_station="opz", active_generation=1, simlog=True, stations=stations,