diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py index f628fdcfa..4b8562af7 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py @@ -27,12 +27,17 @@ class ACFactory: async def get_unconfigured_bot(self) -> Bot: return Bot(await self.get_unconfigured_account()) - async def new_configured_account(self) -> Account: + async def new_preconfigured_account(self) -> Account: + """Make a new account with configuration options set, but configuration not started.""" credentials = await get_temp_credentials() account = await self.get_unconfigured_account() - assert not await account.is_configured() await account.set_config("addr", credentials["email"]) await account.set_config("mail_pw", credentials["password"]) + assert not await account.is_configured() + return account + + async def new_configured_account(self) -> Account: + account = await self.new_preconfigured_account() await account.configure() assert await account.is_configured() return account diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index 5b2e67af9..d1208042e 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -41,6 +41,16 @@ async def test_acfactory(acfactory) -> None: print("Successful configuration") +@pytest.mark.asyncio +async def test_configure_starttls(acfactory) -> None: + account = await acfactory.new_preconfigured_account() + + # Use STARTTLS + await account.set_config("mail_security", "2") + await account.configure() + assert await account.is_configured() + + @pytest.mark.asyncio async def test_account(acfactory) -> None: alice, bob = await acfactory.get_online_accounts(2)