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_seek.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'packages/meshbay-hub/tests/test_video_seek.py') diff --git a/packages/meshbay-hub/tests/test_video_seek.py b/packages/meshbay-hub/tests/test_video_seek.py index 85e774d..665970d 100644 --- a/packages/meshbay-hub/tests/test_video_seek.py +++ b/packages/meshbay-hub/tests/test_video_seek.py @@ -33,13 +33,12 @@ import re import shutil from pathlib import Path +import node_tree import pytest STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static" APP = STATIC / "video-player.js" TRANSPORT = STATIC / "transport.js" -NODE_SERVER = (Path(__file__).resolve().parents[2] / "meshbay-node" / "src" - / "meshbay_node" / "transport" / "webrtc_server.py") pytestmark = pytest.mark.skipif(not APP.exists(), reason="SPA sources unavailable") @@ -59,11 +58,9 @@ def _player(app: str) -> str: @pytest.fixture(scope="module") def stream_fn(): - if not NODE_SERVER.exists(): + if not node_tree.available(): pytest.skip("node sources unavailable") - text = NODE_SERVER.read_text() - i = text.index("async def _stream_video_inner") - return text[i:text.index("\n async def ", i + 1)] + return node_tree.method("_stream_video_inner") def test_the_seek_is_an_index_lookup_not_a_decode(stream_fn): -- cgit v1.2.3