diff options
Diffstat (limited to 'packages/meshbay-hub')
| -rw-r--r-- | packages/meshbay-hub/tests/test_invite_link_client.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_invite_link_client.py b/packages/meshbay-hub/tests/test_invite_link_client.py index c5c0101..be9885a 100644 --- a/packages/meshbay-hub/tests/test_invite_link_client.py +++ b/packages/meshbay-hub/tests/test_invite_link_client.py @@ -96,6 +96,16 @@ def test_one_shape_between_the_hub_and_the_page(tmp_path, monkeypatch): assert got["lower"]["c"] == CODE +def test_the_cli_writes_the_same_link(monkeypatch): + """`meshbay-node member invite --link` builds its link on the node, from the + hub address it was configured with; it must be the hub's own shape.""" + from meshbay_node.ops import _invite_url + monkeypatch.setattr(mail_mod, "_hub_url", "https://hub.example") + n = NODE_PK_STD.replace("+", "-").replace("/", "_").rstrip("=") + assert (_invite_url("https://hub.example/", GROUP, TICKET, NODE_PK_STD, CODE) + == invite_links.invite_url(GROUP, TICKET, n, CODE)) + + @pytest.mark.parametrize("tamper", [ lambda u: u.replace("v=1", "v=2"), lambda u: u.replace(CODE, "K7P2-9WQ"), |