From 328b01a2dd545d70a078db8df1e91b02d65bfc9c Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 23 Sep 2026 22:25:28 +0200 Subject: test: read the WebRTC transport's source as a set of files Source-reading tests take their text from node_source (node) and node_tree (hub): webrtc_server.py plus anything under transport/webrtc/, so a check for something's absence keeps reading the code it guards if that code moves. test_node_source_scope holds the boundary. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_video_stream_switch.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'packages/meshbay-hub/tests/test_video_stream_switch.py') diff --git a/packages/meshbay-hub/tests/test_video_stream_switch.py b/packages/meshbay-hub/tests/test_video_stream_switch.py index 80d9421..7859057 100644 --- a/packages/meshbay-hub/tests/test_video_stream_switch.py +++ b/packages/meshbay-hub/tests/test_video_stream_switch.py @@ -32,6 +32,7 @@ import shutil import subprocess from pathlib import Path +import node_tree import pytest STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static" @@ -149,11 +150,9 @@ def test_stream_messages_are_matched_to_the_file_they_belong_to(app, handler): def test_the_node_actually_stamps_those_messages(): """The guard above is worth nothing if the field is not sent.""" - server = (Path(__file__).resolve().parents[2] / "meshbay-node" / "src" - / "meshbay_node" / "transport" / "webrtc_server.py") - if not server.exists(): + if not node_tree.available(): pytest.skip("the node sources are not available") - text = server.read_text() + text = node_tree.webrtc_source() for const in ("STREAM_INIT", "STREAM_DATA", "STREAM_END"): i = text.index(f"MNP.{const}") block = text[i:i + 400] -- cgit v1.2.3