From 4b15f960e1e21b69a6474a28bb4888f6f0e0f611 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Mon, 26 Dec 2022 18:26:14 -0500 Subject: [PATCH] make get_contact_by_id non-async --- deltachat-rpc-client/src/deltachat_rpc_client/account.py | 2 +- deltachat-rpc-client/tests/test_something.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/account.py b/deltachat-rpc-client/src/deltachat_rpc_client/account.py index c7d02af21..eab67d10d 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/account.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/account.py @@ -108,7 +108,7 @@ class Account: obj = (await obj.get_snapshot()).address return Contact(self, await self._rpc.create_contact(self.id, obj, name)) - async def get_contact_by_id(self, contact_id: int) -> Contact: + def get_contact_by_id(self, contact_id: int) -> Contact: """Return Contact instance for the given contact ID.""" return Contact(self, contact_id) diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index b40a45199..5b2e67af9 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -174,7 +174,7 @@ async def test_contact(acfactory) -> None: bob_addr = await bob.get_config("addr") alice_contact_bob = await alice.create_contact(bob_addr, "Bob") - assert alice_contact_bob == await alice.get_contact_by_id(alice_contact_bob.id) + assert alice_contact_bob == alice.get_contact_by_id(alice_contact_bob.id) assert repr(alice_contact_bob) await alice_contact_bob.block() await alice_contact_bob.unblock()