summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_session_renewal.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_session_renewal.py')
-rw-r--r--packages/meshbay-hub/tests/test_session_renewal.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/meshbay-hub/tests/test_session_renewal.py b/packages/meshbay-hub/tests/test_session_renewal.py
index 38db67f..6c47f7a 100644
--- a/packages/meshbay-hub/tests/test_session_renewal.py
+++ b/packages/meshbay-hub/tests/test_session_renewal.py
@@ -28,6 +28,7 @@ broken client.
import json
import shutil
import subprocess
+import re
from pathlib import Path
import pytest
@@ -223,5 +224,12 @@ def test_the_connection_signs_its_offer_with_a_live_token():
assert "await ensureFreshToken()" in connect, (
"the offer is signed with whatever token the effect captured, which is "
"no longer refreshed by a re-run")
- assert "new window.MeshBayTransport('', live)" in connect, (
- "the transport is built with the captured token rather than the live one")
+ # Asserted on the argument, not on the whole call: the first argument is
+ # the hub's base URL and became configurable when the interface started
+ # shipping in a package. Pinning the literal made this fail for a change
+ # that had nothing to do with tokens.
+ built = re.search(r"new window\.MeshBayTransport\(([^)]*)\)", connect)
+ assert built, "the transport is not built in connect()"
+ args = [a.strip() for a in built.group(1).split(",")]
+ assert args[-1] == "live", (
+ f"the transport is built with {args[-1]!r} rather than the live token")