mirror of
https://github.com/chatmail/core.git
synced 2026-05-18 22:36:29 +03:00
refactor(deltachat-rpc-client): factor out resetup_account()
This commit is contained in:
@@ -59,6 +59,16 @@ class ACFactory:
|
|||||||
def get_online_accounts(self, num: int) -> List[Account]:
|
def get_online_accounts(self, num: int) -> List[Account]:
|
||||||
return [self.get_online_account() for _ in range(num)]
|
return [self.get_online_account() for _ in range(num)]
|
||||||
|
|
||||||
|
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))
|
||||||
|
ac.remove()
|
||||||
|
ac_clone.configure()
|
||||||
|
return ac_clone
|
||||||
|
|
||||||
def send_message(
|
def send_message(
|
||||||
self,
|
self,
|
||||||
to_account: Account,
|
to_account: Account,
|
||||||
|
|||||||
@@ -419,14 +419,7 @@ def test_verified_group_recovery(acfactory, rpc) -> None:
|
|||||||
break
|
break
|
||||||
|
|
||||||
logging.info("ac2 logs in on a new device")
|
logging.info("ac2 logs in on a new device")
|
||||||
ac2.stop_io()
|
ac2 = acfactory.resetup_account(ac2)
|
||||||
ac2_clone = acfactory.get_unconfigured_account()
|
|
||||||
for i in ["addr", "mail_pw"]:
|
|
||||||
ac2_clone.set_config(i, ac2.get_config(i))
|
|
||||||
rpc.remove_account(ac2.id)
|
|
||||||
ac2_clone.configure()
|
|
||||||
ac2 = ac2_clone
|
|
||||||
del ac2_clone
|
|
||||||
|
|
||||||
logging.info("ac2 reverifies with ac3")
|
logging.info("ac2 reverifies with ac3")
|
||||||
qr_code, _svg = ac3.get_qr_code()
|
qr_code, _svg = ac3.get_qr_code()
|
||||||
|
|||||||
Reference in New Issue
Block a user