aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_app_settings_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_app_settings_plugin.py')
-rw-r--r--packages/meshbay-hub/tests/test_app_settings_plugin.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/packages/meshbay-hub/tests/test_app_settings_plugin.py b/packages/meshbay-hub/tests/test_app_settings_plugin.py
index 027fee6..a1ecec7 100644
--- a/packages/meshbay-hub/tests/test_app_settings_plugin.py
+++ b/packages/meshbay-hub/tests/test_app_settings_plugin.py
@@ -15,6 +15,7 @@ fault this refactor's new import graph could otherwise reintroduce.
import re
from pathlib import Path
+import node_tree
import pytest
STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static"
@@ -24,12 +25,6 @@ GROUP_PAGE = STATIC / "group-page.js"
SETTINGS_UI = STATIC / "settings-ui.js"
FOLDER_TREE = STATIC / "folder-tree.js"
TRANSPORT = STATIC / "transport.js"
-# parents[2] is `packages/` — the tests live at
-# packages/meshbay-hub/tests/, so [0] is tests, [1] the package, [2] packages.
-# Got this wrong once and the two cross-package checks below skipped silently,
-# which is worse than not having them: a green run that measured nothing.
-NODE_SERVER = (Path(__file__).resolve().parents[2] / "meshbay-node" / "src"
- / "meshbay_node" / "transport" / "webrtc_server.py")
PANES = ["chat-app-settings.js", "video-app-settings.js",
"music-app-settings.js", "photos-app-settings.js"]
@@ -89,11 +84,10 @@ def test_every_registered_app_has_a_key_the_node_would_accept():
key here that `ALLOWED_APPS` does not have is an app whose settings are
refused by the node with no clue why.
"""
- node = NODE_SERVER
- if not node.exists():
+ if not node_tree.available():
pytest.skip("the node package is not in this checkout")
m = re.search(r"ALLOWED_APPS = frozenset\(\{([^}]*)\}\)",
- node.read_text(encoding="utf-8"))
+ node_tree.webrtc_source())
assert m, "ALLOWED_APPS moved"
allowed = set(re.findall(r"'([^']+)'|\"([^\"]+)\"", m.group(1)))
allowed = {a or b for a, b in allowed}
@@ -207,9 +201,8 @@ def test_the_directory_op_is_signed_and_names_its_app():
assert "admin_challenge" in body and "_authorizeAdminOp" in body
assert "${appKey}:${clean.join(',')}" in body
- node = NODE_SERVER
- if node.exists():
- assert 'f"{app}:{\',\'.join(clean)}"' in node.read_text(encoding="utf-8"), (
+ if node_tree.available():
+ assert 'f"{app}:{\',\'.join(clean)}"' in node_tree.webrtc_source(), (
"the node builds a different subject than the client signs")