comparison tests/e2e/libervia-cli/test_libervia-cli.py @ 3971:9b1d74a6b48c

tests (e2e/cli): add tests for JET: rel 378
author Goffi <goffi@goffi.org>
date Mon, 31 Oct 2022 04:09:38 +0100
parents 2d9d0b77e82b
children 5e3b983ab2c6
comparison
equal deleted inserted replaced
3970:4c3361e2bf55 3971:9b1d74a6b48c
370 json.dumps(signature_json), service=service, node=node, item=item, 370 json.dumps(signature_json), service=service, node=node, item=item,
371 ) 371 )
372 assert sign_data["signer"] == "account1@server1.test" 372 assert sign_data["signer"] == "account1@server1.test"
373 assert sign_data["validated"] == True 373 assert sign_data["validated"] == True
374 assert all(t == "undecided" for t in sign_data["trusts"].values()) 374 assert all(t == "undecided" for t in sign_data["trusts"].values())
375
376 def test_jingle_encrypted_transport_jet(self, fake_file):
377 """A file is sent and received properly with JET OMEMO"""
378 li.encryption.start("account1@server2.test", name="oldmemo")
379 source_file = fake_file.size(10240)
380 source_file_hash = fake_file.get_source_hash(source_file)
381 send_cmd = li.file.send(
382 source_file, "account1@server2.test", encrypt=True, _bg=True
383 )
384 dest_path = fake_file.dest_files / "test_send_receive"
385 dest_path.mkdir()
386 try:
387 li.file.receive(
388 "account1@server1.test", profile="account1_s2", path=dest_path)
389 dest_file = dest_path / source_file.name
390 dest_file_hash = fake_file.get_dest_hash(dest_file)
391 finally:
392 shutil.rmtree(dest_path)
393 send_cmd.wait()
394
395 assert source_file_hash == dest_file_hash
396 li.encryption.stop("account1@server2.test")