aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_hub_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_hub_api.py')
-rw-r--r--packages/meshbay-hub/tests/test_hub_api.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/meshbay-hub/tests/test_hub_api.py b/packages/meshbay-hub/tests/test_hub_api.py
index 724c8ec..5bb6af9 100644
--- a/packages/meshbay-hub/tests/test_hub_api.py
+++ b/packages/meshbay-hub/tests/test_hub_api.py
@@ -658,9 +658,14 @@ async def test_webrtc_signaling_roundtrip(client, app):
from meshbay_hub.api.revocation import _connected_nodes
from meshbay_hub.api.signaling import handle_webrtc_answer
+ node_id = "test-node-sig"
+
class FakeWS:
- def __init__(self):
+ def __init__(self, answering_as):
self.sent = []
+ # An answer is accepted only from the node the offer was relayed
+ # to, so the stand-in has to say which node it is.
+ self._node_id = answering_as
async def send_text(self, text):
self.sent.append(json.loads(text))
@@ -672,10 +677,9 @@ async def test_webrtc_signaling_roundtrip(client, app):
"peer_id": msg["peer_id"],
"sdp": "v=0\r\nanswer-sdp",
"ice_candidates": [{"candidate": "test"}],
- })
+ }, self._node_id)
- fake_ws = FakeWS()
- node_id = "test-node-sig"
+ fake_ws = FakeWS(node_id)
_connected_nodes[node_id] = fake_ws
try: