deltachat-rpc-client 1.159.1__tar.gz → 1.159.2__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 (32) hide show
  1. {deltachat_rpc_client-1.159.1/src/deltachat_rpc_client.egg-info → deltachat_rpc_client-1.159.2}/PKG-INFO +1 -1
  2. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/pyproject.toml +1 -1
  3. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/account.py +8 -2
  4. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/pytestplugin.py +1 -1
  5. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2/src/deltachat_rpc_client.egg-info}/PKG-INFO +1 -1
  6. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_account_events.py +1 -1
  7. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_something.py +33 -11
  8. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/LICENSE +0 -0
  9. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/README.md +0 -0
  10. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/setup.cfg +0 -0
  11. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/__init__.py +0 -0
  12. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/_utils.py +0 -0
  13. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/chat.py +0 -0
  14. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/client.py +0 -0
  15. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/const.py +0 -0
  16. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/contact.py +0 -0
  17. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/deltachat.py +0 -0
  18. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/events.py +0 -0
  19. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/message.py +0 -0
  20. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/py.typed +0 -0
  21. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client/rpc.py +0 -0
  22. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client.egg-info/SOURCES.txt +0 -0
  23. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client.egg-info/dependency_links.txt +0 -0
  24. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client.egg-info/entry_points.txt +0 -0
  25. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/src/deltachat_rpc_client.egg-info/top_level.txt +0 -0
  26. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_chatlist_events.py +0 -0
  27. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_iroh_webxdc.py +0 -0
  28. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_key_transfer.py +0 -0
  29. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_multidevice.py +0 -0
  30. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_securejoin.py +0 -0
  31. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_vcard.py +0 -0
  32. {deltachat_rpc_client-1.159.1 → deltachat_rpc_client-1.159.2}/tests/test_webxdc.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 1.159.1
3
+ Version: 1.159.2
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  Classifier: Development Status :: 5 - Production/Stable
6
6
  Classifier: Intended Audience :: Developers
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deltachat-rpc-client"
7
- version = "1.159.1"
7
+ version = "1.159.2"
8
8
  description = "Python client for Delta Chat core JSON-RPC interface"
9
9
  classifiers = [
10
10
  "Development Status :: 5 - Production/Stable",
@@ -111,9 +111,15 @@ class Account:
111
111
  yield self._rpc.configure.future(self.id)
112
112
 
113
113
  @futuremethod
114
- def add_transport(self, params):
114
+ def add_or_update_transport(self, params):
115
115
  """Add a new transport."""
116
- yield self._rpc.add_transport.future(self.id, params)
116
+ yield self._rpc.add_or_update_transport.future(self.id, params)
117
+
118
+ @futuremethod
119
+ def list_transports(self):
120
+ """Returns the list of all email accounts that are used as a transport in the current profile."""
121
+ transports = yield self._rpc.list_transports.future(self.id)
122
+ return transports
117
123
 
118
124
  def bring_online(self):
119
125
  """Start I/O and wait until IMAP becomes IDLE."""
@@ -34,7 +34,7 @@ class ACFactory:
34
34
  addr, password = self.get_credentials()
35
35
  account = self.get_unconfigured_account()
36
36
  params = {"addr": addr, "password": password}
37
- yield account.add_transport.future(params)
37
+ yield account.add_or_update_transport.future(params)
38
38
 
39
39
  assert account.is_configured()
40
40
  return account
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 1.159.1
3
+ Version: 1.159.2
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  Classifier: Development Status :: 5 - Production/Stable
6
6
  Classifier: Intended Audience :: Developers
@@ -17,7 +17,7 @@ def test_event_on_configuration(acfactory: ACFactory) -> None:
17
17
  account = acfactory.get_unconfigured_account()
18
18
  account.clear_all_events()
19
19
  assert not account.is_configured()
20
- future = account.add_transport.future({"addr": addr, "password": password})
20
+ future = account.add_or_update_transport.future({"addr": addr, "password": password})
21
21
  while True:
22
22
  event = account.wait_for_event()
23
23
  if event.kind == EventType.ACCOUNTS_ITEM_CHANGED:
@@ -63,7 +63,7 @@ def test_acfactory(acfactory) -> None:
63
63
  def test_configure_starttls(acfactory) -> None:
64
64
  addr, password = acfactory.get_credentials()
65
65
  account = acfactory.get_unconfigured_account()
66
- account.add_transport(
66
+ account.add_or_update_transport(
67
67
  {
68
68
  "addr": addr,
69
69
  "password": password,
@@ -74,13 +74,36 @@ def test_configure_starttls(acfactory) -> None:
74
74
  assert account.is_configured()
75
75
 
76
76
 
77
+ def test_lowercase_address(acfactory) -> None:
78
+ addr, password = acfactory.get_credentials()
79
+ addr_upper = addr.upper()
80
+ account = acfactory.get_unconfigured_account()
81
+ account.add_or_update_transport(
82
+ {
83
+ "addr": addr_upper,
84
+ "password": password,
85
+ },
86
+ )
87
+ assert account.is_configured()
88
+ assert addr_upper != addr
89
+ assert account.get_config("configured_addr") == addr
90
+ assert account.list_transports()[0]["addr"] == addr
91
+
92
+ for param in [
93
+ account.get_info()["used_account_settings"],
94
+ account.get_info()["entered_account_settings"],
95
+ ]:
96
+ assert addr in param
97
+ assert addr_upper not in param
98
+
99
+
77
100
  def test_configure_ip(acfactory) -> None:
78
101
  addr, password = acfactory.get_credentials()
79
102
  account = acfactory.get_unconfigured_account()
80
103
  ip_address = socket.gethostbyname(addr.rsplit("@")[-1])
81
104
 
82
105
  with pytest.raises(JsonRpcError):
83
- account.add_transport(
106
+ account.add_or_update_transport(
84
107
  {
85
108
  "addr": addr,
86
109
  "password": password,
@@ -94,7 +117,7 @@ def test_configure_alternative_port(acfactory) -> None:
94
117
  """Test that configuration with alternative port 443 works."""
95
118
  addr, password = acfactory.get_credentials()
96
119
  account = acfactory.get_unconfigured_account()
97
- account.add_transport(
120
+ account.add_or_update_transport(
98
121
  {
99
122
  "addr": addr,
100
123
  "password": password,
@@ -108,14 +131,14 @@ def test_configure_alternative_port(acfactory) -> None:
108
131
  def test_list_transports(acfactory) -> None:
109
132
  addr, password = acfactory.get_credentials()
110
133
  account = acfactory.get_unconfigured_account()
111
- account.add_transport(
134
+ account.add_or_update_transport(
112
135
  {
113
136
  "addr": addr,
114
137
  "password": password,
115
138
  "imapUser": addr,
116
139
  },
117
140
  )
118
- transports = account._rpc.list_transports(account.id)
141
+ transports = account.list_transports()
119
142
  assert len(transports) == 1
120
143
  params = transports[0]
121
144
  assert params["addr"] == addr
@@ -420,7 +443,7 @@ def test_wait_next_messages(acfactory) -> None:
420
443
  addr, password = acfactory.get_credentials()
421
444
  bot = acfactory.get_unconfigured_account()
422
445
  bot.set_config("bot", "1")
423
- bot.add_transport({"addr": addr, "password": password})
446
+ bot.add_or_update_transport({"addr": addr, "password": password})
424
447
  assert bot.is_configured()
425
448
 
426
449
  # There are no old messages and the call returns immediately.
@@ -603,7 +626,7 @@ def test_reactions_for_a_reordering_move(acfactory, direct_imap):
603
626
 
604
627
  addr, password = acfactory.get_credentials()
605
628
  ac2 = acfactory.get_unconfigured_account()
606
- ac2.add_transport({"addr": addr, "password": password})
629
+ ac2.add_or_update_transport({"addr": addr, "password": password})
607
630
  ac2.set_config("mvbox_move", "1")
608
631
  assert ac2.is_configured()
609
632
 
@@ -713,12 +736,11 @@ def test_get_http_response(acfactory):
713
736
 
714
737
  def test_configured_imap_certificate_checks(acfactory):
715
738
  alice = acfactory.new_configured_account()
716
- configured_certificate_checks = alice.get_config("configured_imap_certificate_checks")
717
739
 
718
740
  # Certificate checks should be configured (not None)
719
- assert configured_certificate_checks
741
+ assert "cert_automatic" in alice.get_info().used_account_settings
720
742
 
721
- # 0 is the value old Delta Chat core versions used
743
+ # "cert_old_automatic" is the value old Delta Chat core versions used
722
744
  # to mean user entered "imap_certificate_checks=0" (Automatic)
723
745
  # and configuration failed to use strict TLS checks
724
746
  # so it switched strict TLS checks off.
@@ -729,7 +751,7 @@ def test_configured_imap_certificate_checks(acfactory):
729
751
  #
730
752
  # Core 1.142.4, 1.142.5 and 1.142.6 saved this value due to bug.
731
753
  # This test is a regression test to prevent this happening again.
732
- assert configured_certificate_checks != "0"
754
+ assert "cert_old_automatic" not in alice.get_info().used_account_settings
733
755
 
734
756
 
735
757
  def test_no_old_msg_is_fresh(acfactory):