summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_root_writable_policy.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_root_writable_policy.py')
-rw-r--r--packages/meshbay-node/tests/test_root_writable_policy.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/meshbay-node/tests/test_root_writable_policy.py b/packages/meshbay-node/tests/test_root_writable_policy.py
index 730e636..23b55cb 100644
--- a/packages/meshbay-node/tests/test_root_writable_policy.py
+++ b/packages/meshbay-node/tests/test_root_writable_policy.py
@@ -64,8 +64,8 @@ def _session(tmp_path: Path, user_id: str, *,
return session
-def _upload(session, filename="clip.mp4", body=b"bytes"):
- session._do_file_upload(sealed_upload(
+async def _upload(session, filename="clip.mp4", body=b"bytes"):
+ await session._do_file_upload(sealed_upload(
session, filename=filename, data=body, dir="shared"))
@@ -79,7 +79,7 @@ def _uploads_dir(session) -> Path:
async def test_a_member_cannot_upload_to_a_read_only_root(tmp_path):
session = _session(tmp_path, "member-1", writable=False)
- _upload(session)
+ await _upload(session)
refusal = [m for m in session.sent if m.get("type") == "error"]
assert refusal and refusal[0].get("code") == "root_read_only"
@@ -88,7 +88,7 @@ async def test_a_member_cannot_upload_to_a_read_only_root(tmp_path):
async def test_members_upload_normally_to_a_writable_root(tmp_path):
session = _session(tmp_path, "member-1", writable=True)
- _upload(session)
+ await _upload(session)
assert not [m for m in session.sent if m.get("type") == "error"]
assert (_uploads_dir(session) / "clip.mp4").read_bytes() == b"bytes"
@@ -103,7 +103,7 @@ async def test_read_only_binds_the_operator_too(tmp_path):
session = _session(tmp_path, "the-operator", writable=False,
operator="the-operator")
session._is_node_admin = lambda: True
- _upload(session)
+ await _upload(session)
refusal = [m for m in session.sent if m.get("type") == "error"]
assert refusal and refusal[0].get("code") == "root_read_only"
@@ -249,6 +249,6 @@ async def test_no_message_can_reopen_uploads_for_a_whole_group(tmp_path):
"the node answered an instruction it does not implement")
# And the door is still shut.
- _upload(session)
+ await _upload(session)
refusal = [m for m in session.sent if m.get("type") == "error"]
assert refusal and refusal[0].get("code") == "root_read_only"