diff options
Diffstat (limited to 'packages/meshbay-hub')
| -rw-r--r-- | packages/meshbay-hub/tests/test_upload_seal_client.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/meshbay-hub/tests/test_upload_seal_client.py b/packages/meshbay-hub/tests/test_upload_seal_client.py index d233ccd..63be6e3 100644 --- a/packages/meshbay-hub/tests/test_upload_seal_client.py +++ b/packages/meshbay-hub/tests/test_upload_seal_client.py @@ -110,7 +110,7 @@ def test_the_browser_puts_no_filename_and_no_content_on_the_wire(_sent): assert msg["type"] == MNP.FILE_UPLOAD -def test_a_real_node_opens_what_the_real_browser_sealed(tmp_path, _gek, _sent): +async def test_a_real_node_opens_what_the_real_browser_sealed(tmp_path, _gek, _sent): """ End to end: the shipped browser encoder into the shipped node handler, with the file that lands on disk as the assertion. A mismatch in the HKDF salt, @@ -119,7 +119,7 @@ def test_a_real_node_opens_what_the_real_browser_sealed(tmp_path, _gek, _sent): """ session = _node_session(tmp_path, _gek) for hexframe in _sent["frames"]: - session._do_file_upload(msgpack.unpackb(bytes.fromhex(hexframe), raw=False)) + await session._do_file_upload(msgpack.unpackb(bytes.fromhex(hexframe), raw=False)) errors = [m for m in session.sent if m.get("type") == "error"] assert not errors, f"the node refused a frame the browser built: {errors[:1]}" @@ -129,7 +129,7 @@ def test_a_real_node_opens_what_the_real_browser_sealed(tmp_path, _gek, _sent): assert not list(root.glob("*.part")), "a temp file was left behind" -def test_the_caller_is_told_the_name_the_node_chose(tmp_path, _gek, _sent): +async def test_the_caller_is_told_the_name_the_node_chose(tmp_path, _gek, _sent): """ `stored_as` is sealed now, so reading it takes a decrypt that can fail silently. It must not: the node finds a free name rather than replacing @@ -145,7 +145,7 @@ def test_the_caller_is_told_the_name_the_node_chose(tmp_path, _gek, _sent): (session._ctx["roots"].roots[0].path / "holiday.jpg").write_bytes(b"someone else's") for hexframe in _sent["frames"]: - session._do_file_upload(msgpack.unpackb(bytes.fromhex(hexframe), raw=False)) + await session._do_file_upload(msgpack.unpackb(bytes.fromhex(hexframe), raw=False)) acks = [msgpack.packb(m, use_bin_type=True).hex() for m in session.sent if m.get("type") == MNP.FILE_UPLOAD_ACK] assert len(acks) == len(_sent["frames"]) @@ -156,7 +156,7 @@ def test_the_caller_is_told_the_name_the_node_chose(tmp_path, _gek, _sent): assert result["stored"]["dir"] == "library" -def test_an_interrupted_upload_resumes_where_the_node_stopped(tmp_path, _gek): +async def test_an_interrupted_upload_resumes_where_the_node_stopped(tmp_path, _gek): """ The browser asks, the node answers, and the second attempt sends only what is missing. @@ -177,12 +177,12 @@ def test_an_interrupted_upload_resumes_where_the_node_stopped(tmp_path, _gek): # The link drops after two chunks. session = _node_session(tmp_path, _gek) for frame in frames[1:3]: - session._do_file_upload(frame) + await session._do_file_upload(frame) assert not [m for m in session.sent if m.get("type") == "error"] # It comes back and asks. session.sent.clear() - session._do_file_upload(frames[0]) + await session._do_file_upload(frames[0]) probe_ack = msgpack.packb(session.sent[-1], use_bin_type=True).hex() second = _run_probe(_probe_input( |