diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/client.py b/deltachat-rpc-client/src/deltachat_rpc_client/client.py index a62c22deb..5b15914bb 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/client.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/client.py @@ -83,11 +83,10 @@ class Client: def configure(self, email: str, password: str, **kwargs) -> None: """Configure the client.""" - self.account.set_config("addr", email) - self.account.set_config("mail_pw", password) for key, value in kwargs.items(): self.account.set_config(key, value) - self.account.configure() + params = {"addr": email, "password": password} + self.account.add_or_update_transport(params) self.logger.debug("Account configured") def run_forever(self) -> None: diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py index 5b7a3907a..2f8324277 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py @@ -73,11 +73,12 @@ class ACFactory: def resetup_account(self, ac: Account) -> Account: """Resetup account from scratch, losing the encryption key.""" ac.stop_io() - ac_clone = self.get_unconfigured_account() - for i in ["addr", "mail_pw"]: - ac_clone.set_config(i, ac.get_config(i)) + addr = ac.get_config("addr") + password = ac.get_config("mail_pw") ac.remove() - ac_clone.configure() + ac_clone = self.get_unconfigured_account() + params = {"addr": addr, "password": password} + ac_clone.add_or_update_transport(params) return ac_clone def get_accepted_chat(self, ac1: Account, ac2: Account) -> Chat: diff --git a/deltachat-rpc-client/tests/test_key_transfer.py b/deltachat-rpc-client/tests/test_key_transfer.py index 2fc2143fa..44229f57f 100644 --- a/deltachat-rpc-client/tests/test_key_transfer.py +++ b/deltachat-rpc-client/tests/test_key_transfer.py @@ -18,9 +18,7 @@ def test_autocrypt_setup_message_key_transfer(acfactory): alice1 = acfactory.get_online_account() alice2 = acfactory.get_unconfigured_account() - alice2.set_config("addr", alice1.get_config("addr")) - alice2.set_config("mail_pw", alice1.get_config("mail_pw")) - alice2.configure() + alice2.add_or_update_transport({"addr": alice1.get_config("addr"), "password": alice1.get_config("mail_pw")}) alice2.bring_online() setup_code = alice1.initiate_autocrypt_key_transfer() @@ -37,9 +35,7 @@ def test_ac_setup_message_twice(acfactory): alice1 = acfactory.get_online_account() alice2 = acfactory.get_unconfigured_account() - alice2.set_config("addr", alice1.get_config("addr")) - alice2.set_config("mail_pw", alice1.get_config("mail_pw")) - alice2.configure() + alice2.add_or_update_transport({"addr": alice1.get_config("addr"), "password": alice1.get_config("mail_pw")}) alice2.bring_online() # Send the first Autocrypt Setup Message and ignore it.