deltachat-rpc-client 2.34.0__tar.gz → 2.36.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {deltachat_rpc_client-2.34.0/src/deltachat_rpc_client.egg-info → deltachat_rpc_client-2.36.0}/PKG-INFO +1 -1
  2. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/pyproject.toml +1 -1
  3. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0/src/deltachat_rpc_client.egg-info}/PKG-INFO +1 -1
  4. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_multitransport.py +55 -0
  5. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_something.py +104 -8
  6. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/LICENSE +0 -0
  7. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/README.md +0 -0
  8. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/setup.cfg +0 -0
  9. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/__init__.py +0 -0
  10. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/_utils.py +0 -0
  11. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/account.py +0 -0
  12. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/chat.py +0 -0
  13. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/client.py +0 -0
  14. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/const.py +0 -0
  15. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/contact.py +0 -0
  16. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/deltachat.py +0 -0
  17. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/events.py +0 -0
  18. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/message.py +0 -0
  19. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/py.typed +0 -0
  20. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/pytestplugin.py +0 -0
  21. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client/rpc.py +0 -0
  22. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client.egg-info/SOURCES.txt +0 -0
  23. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client.egg-info/dependency_links.txt +0 -0
  24. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client.egg-info/entry_points.txt +0 -0
  25. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/src/deltachat_rpc_client.egg-info/top_level.txt +0 -0
  26. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_account_events.py +0 -0
  27. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_calls.py +0 -0
  28. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_chatlist_events.py +0 -0
  29. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_cross_core.py +0 -0
  30. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_folders.py +0 -0
  31. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_iroh_webxdc.py +0 -0
  32. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_key_transfer.py +0 -0
  33. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_multidevice.py +0 -0
  34. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_securejoin.py +0 -0
  35. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_vcard.py +0 -0
  36. {deltachat_rpc_client-2.34.0 → deltachat_rpc_client-2.36.0}/tests/test_webxdc.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 2.34.0
3
+ Version: 2.36.0
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  License-Expression: MPL-2.0
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deltachat-rpc-client"
7
- version = "2.34.0"
7
+ version = "2.36.0"
8
8
  license = "MPL-2.0"
9
9
  description = "Python client for Delta Chat core JSON-RPC interface"
10
10
  classifiers = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 2.34.0
3
+ Version: 2.36.0
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  License-Expression: MPL-2.0
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -221,3 +221,58 @@ def test_recognize_self_address(acfactory) -> None:
221
221
  bob_chat.send_text("Hello!")
222
222
  msg = alice.wait_for_incoming_msg().get_snapshot()
223
223
  assert msg.chat == alice.create_chat(bob)
224
+
225
+
226
+ def test_transport_limit(acfactory) -> None:
227
+ """Test transports limit."""
228
+ account = acfactory.get_online_account()
229
+ qr = acfactory.get_account_qr()
230
+
231
+ limit = 5
232
+
233
+ for _ in range(1, limit):
234
+ account.add_transport_from_qr(qr)
235
+
236
+ assert len(account.list_transports()) == limit
237
+
238
+ with pytest.raises(JsonRpcError):
239
+ account.add_transport_from_qr(qr)
240
+
241
+ second_addr = account.list_transports()[1]["addr"]
242
+ account.delete_transport(second_addr)
243
+
244
+ # test that adding a transport after deleting one works again
245
+ account.add_transport_from_qr(qr)
246
+
247
+
248
+ def test_message_info_imap_urls(acfactory, log) -> None:
249
+ """Test that message info contains IMAP URLs of where the message was received."""
250
+ alice, bob = acfactory.get_online_accounts(2)
251
+
252
+ log.section("Alice adds ac1 clone removes second transport")
253
+ qr = acfactory.get_account_qr()
254
+ for i in range(3):
255
+ alice.add_transport_from_qr(qr)
256
+ # Wait for all transports to go IDLE after adding each one.
257
+ for _ in range(i + 1):
258
+ alice.bring_online()
259
+
260
+ new_alice_addr = alice.list_transports()[2]["addr"]
261
+ alice.set_config("configured_addr", new_alice_addr)
262
+
263
+ # Enable multi-device mode so messages are not deleted immediately.
264
+ alice.set_config("bcc_self", "1")
265
+
266
+ # Bob creates chat, learning about Alice's currently selected transport.
267
+ # This is where he will send the message.
268
+ bob_chat = bob.create_chat(alice)
269
+
270
+ # Alice changes the transport again.
271
+ alice.set_config("configured_addr", alice.list_transports()[3]["addr"])
272
+
273
+ bob_chat.send_text("Hello!")
274
+
275
+ msg = alice.wait_for_incoming_msg()
276
+ for alice_transport in alice.list_transports():
277
+ addr = alice_transport["addr"]
278
+ assert (addr == new_alice_addr) == (addr in msg.get_info())
@@ -90,12 +90,9 @@ def test_lowercase_address(acfactory) -> None:
90
90
  assert account.get_config("configured_addr") == addr
91
91
  assert account.list_transports()[0]["addr"] == addr
92
92
 
93
- for param in [
94
- account.get_info()["used_account_settings"],
95
- account.get_info()["entered_account_settings"],
96
- ]:
97
- assert addr in param
98
- assert addr_upper not in param
93
+ param = account.get_info()["used_transport_settings"]
94
+ assert addr in param
95
+ assert addr_upper not in param
99
96
 
100
97
 
101
98
  def test_configure_ip(acfactory) -> None:
@@ -343,9 +340,11 @@ def test_receive_imf_failure(acfactory) -> None:
343
340
  msg_id = event.msg_id
344
341
  message = bob.get_message_by_id(msg_id)
345
342
  snapshot = message.get_snapshot()
343
+ version = bob.get_info()["deltachat_core_version"]
346
344
  assert (
347
345
  snapshot.text == "❌ Failed to receive a message:"
348
346
  " Condition failed: `!context.get_config_bool(Config::FailOnReceivingFullMsg).await?`."
347
+ f" Core version {version}."
349
348
  " Please report this bug to delta@merlinux.eu or https://support.delta.chat/."
350
349
  )
351
350
 
@@ -508,6 +507,103 @@ def test_import_export_backup(acfactory, tmp_path) -> None:
508
507
  assert alice2.manager.get_system_info()
509
508
 
510
509
 
510
+ def test_import_export_online_all(acfactory, tmp_path, data, log) -> None:
511
+ (ac1, some1) = acfactory.get_online_accounts(2)
512
+
513
+ log.section("create some chat content")
514
+ some1_addr = some1.get_config("addr")
515
+ chat1 = ac1.create_contact(some1).create_chat()
516
+ chat1.send_text("msg1")
517
+ assert len(ac1.get_contacts()) == 1
518
+
519
+ original_image_path = data.get_path("image/avatar64x64.png")
520
+ chat1.send_file(str(original_image_path))
521
+
522
+ # Add another 100KB file that ensures that the progress is smooth enough
523
+ path = tmp_path / "attachment.txt"
524
+ with path.open("w") as file:
525
+ file.truncate(100000)
526
+ chat1.send_file(str(path))
527
+
528
+ def assert_account_is_proper(ac):
529
+ contacts = ac.get_contacts()
530
+ assert len(contacts) == 1
531
+ contact2 = contacts[0]
532
+ assert contact2.get_snapshot().address == some1_addr
533
+ chat2 = contact2.create_chat()
534
+ messages = chat2.get_messages()
535
+ assert len(messages) == 3 + E2EE_INFO_MSGS
536
+ assert messages[0 + E2EE_INFO_MSGS].get_snapshot().text == "msg1"
537
+ snapshot = messages[1 + E2EE_INFO_MSGS].get_snapshot()
538
+ assert snapshot.file_mime == "image/png"
539
+ assert os.stat(snapshot.file).st_size == os.stat(original_image_path).st_size
540
+ ac.set_config("displayname", "new displayname")
541
+ assert ac.get_config("displayname") == "new displayname"
542
+
543
+ assert_account_is_proper(ac1)
544
+
545
+ backupdir = tmp_path / "backup"
546
+ backupdir.mkdir()
547
+
548
+ log.section(f"export all to {backupdir}")
549
+ ac1.stop_io()
550
+ ac1.export_backup(backupdir)
551
+ progress = 0
552
+ files_written = []
553
+ while True:
554
+ event = ac1.wait_for_event()
555
+ if event.kind == EventType.IMEX_PROGRESS:
556
+ assert event.progress > 0 # Progress 0 indicates error.
557
+ assert event.progress < progress + 250
558
+ progress = event.progress
559
+ if progress == 1000:
560
+ break
561
+ elif event.kind == EventType.IMEX_FILE_WRITTEN:
562
+ files_written.append(event.path)
563
+ else:
564
+ logging.info(event)
565
+ assert len(files_written) == 1
566
+ assert os.path.exists(files_written[0])
567
+ ac1.start_io()
568
+
569
+ log.section("get fresh empty account")
570
+ ac2 = acfactory.get_unconfigured_account()
571
+
572
+ log.section("import backup and check it's proper")
573
+ ac2.import_backup(files_written[0])
574
+ progress = 0
575
+ while True:
576
+ event = ac2.wait_for_event()
577
+ if event.kind == EventType.IMEX_PROGRESS:
578
+ assert event.progress > 0 # Progress 0 indicates error.
579
+ assert event.progress < progress + 250
580
+ progress = event.progress
581
+ if progress == 1000:
582
+ break
583
+ else:
584
+ logging.info(event)
585
+ assert_account_is_proper(ac1)
586
+ assert_account_is_proper(ac2)
587
+
588
+ log.section(f"Second-time export all to {backupdir}")
589
+ ac1.stop_io()
590
+ ac1.export_backup(backupdir)
591
+ while True:
592
+ event = ac1.wait_for_event()
593
+ if event.kind == EventType.IMEX_PROGRESS:
594
+ assert event.progress > 0
595
+ if event.progress == 1000:
596
+ break
597
+ elif event.kind == EventType.IMEX_FILE_WRITTEN:
598
+ files_written.append(event.path)
599
+ else:
600
+ logging.info(event)
601
+ assert len(files_written) == 2
602
+ assert os.path.exists(files_written[1])
603
+ assert files_written[1] != files_written[0]
604
+ assert len(list(backupdir.glob("*.tar"))) == 2
605
+
606
+
511
607
  def test_import_export_keys(acfactory, tmp_path) -> None:
512
608
  alice, bob = acfactory.get_online_accounts(2)
513
609
 
@@ -733,7 +829,7 @@ def test_configured_imap_certificate_checks(acfactory):
733
829
  alice = acfactory.new_configured_account()
734
830
 
735
831
  # Certificate checks should be configured (not None)
736
- assert "cert_strict" in alice.get_info().used_account_settings
832
+ assert "cert_strict" in alice.get_info().used_transport_settings
737
833
 
738
834
  # "cert_old_automatic" is the value old Delta Chat core versions used
739
835
  # to mean user entered "imap_certificate_checks=0" (Automatic)
@@ -746,7 +842,7 @@ def test_configured_imap_certificate_checks(acfactory):
746
842
  #
747
843
  # Core 1.142.4, 1.142.5 and 1.142.6 saved this value due to bug.
748
844
  # This test is a regression test to prevent this happening again.
749
- assert "cert_old_automatic" not in alice.get_info().used_account_settings
845
+ assert "cert_old_automatic" not in alice.get_info().used_transport_settings
750
846
 
751
847
 
752
848
  def test_no_old_msg_is_fresh(acfactory):