aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_roster_pairing.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_roster_pairing.py')
-rw-r--r--packages/meshbay-node/tests/test_roster_pairing.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/packages/meshbay-node/tests/test_roster_pairing.py b/packages/meshbay-node/tests/test_roster_pairing.py
index 91191c1..038f12c 100644
--- a/packages/meshbay-node/tests/test_roster_pairing.py
+++ b/packages/meshbay-node/tests/test_roster_pairing.py
@@ -23,6 +23,7 @@ from meshbay_common.join import ROLE_MEMBER, ROLE_OPERATOR, join_transcript
from meshbay_node.indexer.group_index import GroupIndex
from meshbay_node.roster import Roster, hash_code, normalize_code
from meshbay_node.transport.webrtc_server import WebRTCPeerSession
+from node_source import session_method, webrtc_source
from conftest import one_root
@@ -568,9 +569,7 @@ def test_challenge_carries_node_pk_in_source():
Belt and braces for the above: the field must be in the message the node
builds, whatever the surrounding handshake does.
"""
- source = (Path(__file__).parent.parent
- / "src" / "meshbay_node" / "transport"
- / "webrtc_server.py").read_text(encoding="utf-8")
+ source = webrtc_source()
challenge = source[source.find("MNP.HANDSHAKE_CHALLENGE,"):]
challenge = challenge[:challenge.find("})")]
assert "node_pk" in challenge, (
@@ -899,9 +898,7 @@ def test_admin_authority_is_never_fetched_from_the_hub():
"""
src = Path(__file__).parent.parent / "src" / "meshbay_node"
- verifier = (src / "transport" / "webrtc_server.py").read_text(encoding="utf-8")
- body = verifier[verifier.index("async def _verify_admin_sig"):]
- body = body[:body.index("\n def ", 1)]
+ body = session_method("_verify_admin_sig")
assert "operator_pks" in body, "the roster is where authority comes from"
# Past the docstring: it names what was removed on purpose, so a reader knows
# not to put it back. What must not reappear is code.