diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_group_hosting.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_group_hosting.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/packages/meshbay-hub/tests/test_group_hosting.py b/packages/meshbay-hub/tests/test_group_hosting.py index ad5f57d..c571771 100644 --- a/packages/meshbay-hub/tests/test_group_hosting.py +++ b/packages/meshbay-hub/tests/test_group_hosting.py @@ -58,7 +58,7 @@ async def _mark_hosted(db_session, group_id, when=None): @pytest.mark.asyncio async def test_the_owner_sees_their_unhosted_group(client): """They have to: it is the page they set the node up from.""" - owner = await _user(client, "setup1") + owner = await _user(client, "setup1_test") r = await _group(client, owner, "not-yet") assert r.status_code == 201 @@ -70,7 +70,7 @@ async def test_the_owner_sees_their_unhosted_group(client): @pytest.mark.asyncio async def test_a_member_does_not_see_an_unhosted_group(client): """A name they cannot open, with no way to say why, is worse than nothing.""" - owner = await _user(client, "setup2") + owner = await _user(client, "setup2_test") member = await _user(client, "early_bird") gid = (await _group(client, owner, "premature")).json()["group_id"] await client.post(f"/v1/groups/{gid}/members/early_bird", json={}, headers=owner) @@ -81,10 +81,10 @@ async def test_a_member_does_not_see_an_unhosted_group(client): @pytest.mark.asyncio async def test_a_member_sees_it_once_a_node_has_announced_it(client, db_session): - owner = await _user(client, "setup3") - member = await _user(client, "patient") + owner = await _user(client, "setup3_test") + member = await _user(client, "patient_test") gid = (await _group(client, owner, "ready")).json()["group_id"] - await client.post(f"/v1/groups/{gid}/members/patient", json={}, headers=owner) + await client.post(f"/v1/groups/{gid}/members/patient_test", json={}, headers=owner) await _mark_hosted(db_session, gid) @@ -95,7 +95,7 @@ async def test_a_member_sees_it_once_a_node_has_announced_it(client, db_session) @pytest.mark.asyncio async def test_the_public_directory_hides_unhosted_groups(client, db_session): - owner = await _user(client, "setup4") + owner = await _user(client, "setup4_test") hidden = (await _group(client, owner, "pub-unhosted", "public")).json()["group_id"] shown = (await _group(client, owner, "pub-hosted", "public")).json()["group_id"] await _mark_hosted(db_session, shown) @@ -109,7 +109,7 @@ async def test_the_public_directory_hides_unhosted_groups(client, db_session): @pytest.mark.asyncio async def test_a_group_stays_visible_when_its_node_goes_offline(client, db_session): """`hosted_at` records that a node existed, not that one is answering now.""" - owner = await _user(client, "setup5") + owner = await _user(client, "setup5_test") gid = (await _group(client, owner, "quiet-node", "public")).json()["group_id"] await _mark_hosted(db_session, gid) @@ -121,7 +121,7 @@ async def test_a_group_stays_visible_when_its_node_goes_offline(client, db_sessi @pytest.mark.asyncio async def test_a_fresh_unhosted_group_is_left_alone(client, db_session): - owner = await _user(client, "reaper1") + owner = await _user(client, "reaper1_test") gid = (await _group(client, owner, "brand-new")).json()["group_id"] assert await find_unhosted_groups(db_session) == [] @@ -130,7 +130,7 @@ async def test_a_fresh_unhosted_group_is_left_alone(client, db_session): @pytest.mark.asyncio async def test_an_unhosted_group_past_the_grace_period_is_collected(client, db_session): - owner = await _user(client, "reaper2") + owner = await _user(client, "reaper2_test") gid = (await _group(client, owner, "abandoned")).json()["group_id"] g = await db_session.get(Group, gid) @@ -145,7 +145,7 @@ async def test_an_unhosted_group_past_the_grace_period_is_collected(client, db_s @pytest.mark.asyncio async def test_an_old_group_that_was_hosted_is_never_collected(client, db_session): """The whole point of the column: age alone must not condemn a group.""" - owner = await _user(client, "reaper3") + owner = await _user(client, "reaper3_test") gid = (await _group(client, owner, "long-lived")).json()["group_id"] g = await db_session.get(Group, gid) @@ -158,7 +158,7 @@ async def test_an_old_group_that_was_hosted_is_never_collected(client, db_sessio @pytest.mark.asyncio async def test_dry_run_reports_without_deleting(client, db_session): - owner = await _user(client, "reaper4") + owner = await _user(client, "reaper4_test") gid = (await _group(client, owner, "still-here")).json()["group_id"] g = await db_session.get(Group, gid) g.created_at = datetime.now(timezone.utc) - timedelta(days=30) @@ -172,7 +172,7 @@ async def test_dry_run_reports_without_deleting(client, db_session): @pytest.mark.asyncio async def test_collecting_a_group_takes_its_memberships_with_it(client, db_session): """Nothing cascades in the schema, and an orphan row keeps the group in /mine.""" - owner = await _user(client, "reaper5") + owner = await _user(client, "reaper5_test") await _user(client, "tagalong") gid = (await _group(client, owner, "doomed")).json()["group_id"] await client.post(f"/v1/groups/{gid}/members/tagalong", json={}, headers=owner) @@ -198,7 +198,7 @@ async def test_a_public_group_cannot_be_invite_only(client): the only channel is the hub, so a one-time code would travel through the party it exists to exclude. """ - owner = await _user(client, "policy1") + owner = await _user(client, "policy1_test") r = await _group(client, owner, "contradiction", "public", join_policy="invite") assert r.status_code == 422, r.text assert "private" in r.json()["detail"] @@ -206,14 +206,14 @@ async def test_a_public_group_cannot_be_invite_only(client): @pytest.mark.asyncio async def test_a_public_group_is_open(client): - owner = await _user(client, "policy2") + owner = await _user(client, "policy2_test") r = await _group(client, owner, "welcoming", "public", join_policy="open") assert r.status_code == 201, r.text @pytest.mark.asyncio async def test_a_private_group_is_invite_only_by_default(client, db_session): - owner = await _user(client, "policy3") + owner = await _user(client, "policy3_test") gid = (await _group(client, owner, "closed")).json()["group_id"] assert (await db_session.get(Group, gid)).join_policy == "invite" @@ -230,7 +230,7 @@ async def test_node_registration_stamps_hosted_at(client, db_session): """ from meshbay_hub.api.revocation import _mark_hosted - owner = await _user(client, "stamped") + owner = await _user(client, "stamped_test") gid = (await _group(client, owner, "about-to-be-hosted")).json()["group_id"] assert (await db_session.get(Group, gid)).hosted_at is None |