aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_transport_contracts.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_transport_contracts.py')
-rw-r--r--packages/meshbay-hub/tests/test_transport_contracts.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/meshbay-hub/tests/test_transport_contracts.py b/packages/meshbay-hub/tests/test_transport_contracts.py
index 28d6a10..76e8123 100644
--- a/packages/meshbay-hub/tests/test_transport_contracts.py
+++ b/packages/meshbay-hub/tests/test_transport_contracts.py
@@ -19,6 +19,7 @@ import re
from pathlib import Path
import pytest
+from spa_source import search_source
STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static"
TRANSPORT = STATIC / "transport.js"
@@ -521,7 +522,7 @@ SEARCH_PAGE = STATIC / "search-page.js"
def test_search_tries_every_node_the_hub_offers():
- code = _code_only(SEARCH_PAGE.read_text(encoding="utf-8"))
+ code = _code_only(search_source())
assert "nodes[0]" not in code, "Search takes the head of the node list again"
walk = code[code.index("for (const n of nodesData.nodes)"):]
walk = walk[:walk.index("throw (lastErr")]
@@ -534,7 +535,7 @@ def test_search_connects_in_one_place():
"""Two call sites with their own connect is how one of them kept `nodes[0]`,
and how the sweep and the warm-up each negotiated the same group: every
connection goes through the pool, and only the pool calls `connectToGroup`."""
- code = _code_only(SEARCH_PAGE.read_text(encoding="utf-8"))
+ code = _code_only(search_source())
assert code.count("transport.connect(") == 1
# The definition, and the pool's one call.
assert code.count("connectToGroup(") == 2