changeset 4236:f59e9421a650

test (unit/cli): Add a file send/receive test for WebRTC: fix 442
author Goffi <goffi@goffi.org>
date Sat, 06 Apr 2024 15:21:00 +0200
parents d28ad04049c7
children a1e7e82a8921
files tests/e2e/libervia-cli/test_libervia-cli.py
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/e2e/libervia-cli/test_libervia-cli.py	Sat Apr 06 15:04:07 2024 +0200
+++ b/tests/e2e/libervia-cli/test_libervia-cli.py	Sat Apr 06 15:21:00 2024 +0200
@@ -295,6 +295,26 @@
 
         assert source_file_hash == dest_file_hash
 
+    def test_send_receive_webrtc(self, fake_file):
+        source_file = fake_file.size(10240)
+        source_file_hash = fake_file.get_source_hash(source_file)
+        send_cmd = li.file.send(
+            source_file, "account1@server2.test", webrtc=True, _bg=True
+        )
+        dest_path = fake_file.dest_files / "test_send_receive"
+        dest_path.mkdir()
+        try:
+            li.file.receive(
+                "account1@server1.test", profile="account1_s2", path=dest_path)
+            dest_file = dest_path / source_file.name
+            dest_file_hash = fake_file.get_dest_hash(dest_file)
+        finally:
+            shutil.rmtree(dest_path)
+        send_cmd.wait()
+
+        assert source_file_hash == dest_file_hash
+
+
 
 class TestE2EEncryption: