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-node/tests/test_upload_size_cap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-node/tests/test_upload_size_cap.py') diff --git a/packages/meshbay-node/tests/test_upload_size_cap.py b/packages/meshbay-node/tests/test_upload_size_cap.py index cc04eba..dbb14d9 100644 --- a/packages/meshbay-node/tests/test_upload_size_cap.py +++ b/packages/meshbay-node/tests/test_upload_size_cap.py @@ -25,6 +25,7 @@ from meshbay_node.transport.webrtc_server import ( WebRTCPeerSession, WebRTCTransport, ) +from node_source import webrtc_source def _cfg(tmp_path: Path, body: str): @@ -115,8 +116,7 @@ def test_the_handler_reads_it_rather_than_the_constant(): is already in flight — which it does only if the handler asks the context each time instead of closing over the constant. """ - src = (Path(__file__).resolve().parents[1] / "src" / "meshbay_node" - / "transport" / "webrtc_server.py").read_text(encoding="utf-8") + src = webrtc_source() i = src.index("Upload exceeds size limit") check = src[src.rindex("if state.bytes", 0, i):i] assert "_max_upload_bytes()" in check, ( -- cgit v1.2.3