comparison tests/e2e/libervia-cli/test_libervia-cli.py @ 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 dfccc90cacc6
children
comparison
equal deleted inserted replaced
4235:d28ad04049c7 4236:f59e9421a650
293 shutil.rmtree(dest_path) 293 shutil.rmtree(dest_path)
294 send_cmd.wait() 294 send_cmd.wait()
295 295
296 assert source_file_hash == dest_file_hash 296 assert source_file_hash == dest_file_hash
297 297
298 def test_send_receive_webrtc(self, fake_file):
299 source_file = fake_file.size(10240)
300 source_file_hash = fake_file.get_source_hash(source_file)
301 send_cmd = li.file.send(
302 source_file, "account1@server2.test", webrtc=True, _bg=True
303 )
304 dest_path = fake_file.dest_files / "test_send_receive"
305 dest_path.mkdir()
306 try:
307 li.file.receive(
308 "account1@server1.test", profile="account1_s2", path=dest_path)
309 dest_file = dest_path / source_file.name
310 dest_file_hash = fake_file.get_dest_hash(dest_file)
311 finally:
312 shutil.rmtree(dest_path)
313 send_cmd.wait()
314
315 assert source_file_hash == dest_file_hash
316
317
298 318
299 class TestE2EEncryption: 319 class TestE2EEncryption:
300 320
301 def test_pubsub_encryption_oxps(self, li_elt): 321 def test_pubsub_encryption_oxps(self, li_elt):
302 secret_blog = "this is a secret blog post" 322 secret_blog = "this is a secret blog post"