mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
chore: fix some types in deltachat_rpc_client
This commit is contained in:
@@ -272,7 +272,7 @@ class Account:
|
|||||||
return Contact(self, SpecialContactId.SELF)
|
return Contact(self, SpecialContactId.SELF)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_contact(self) -> Chat:
|
def device_contact(self) -> Contact:
|
||||||
"""Account's device contact."""
|
"""Account's device contact."""
|
||||||
return Contact(self, SpecialContactId.DEVICE)
|
return Contact(self, SpecialContactId.DEVICE)
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class Message:
|
|||||||
yield self._rpc.send_webxdc_realtime_advertisement.future(self.account.id, self.id)
|
yield self._rpc.send_webxdc_realtime_advertisement.future(self.account.id, self.id)
|
||||||
|
|
||||||
@futuremethod
|
@futuremethod
|
||||||
def send_webxdc_realtime_data(self, data) -> None:
|
def send_webxdc_realtime_data(self, data):
|
||||||
"""Send data to the realtime channel."""
|
"""Send data to the realtime channel."""
|
||||||
yield self._rpc.send_webxdc_realtime_data.future(self.account.id, self.id, list(data))
|
yield self._rpc.send_webxdc_realtime_data.future(self.account.id, self.id, list(data))
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class RPCAccountFactory:
|
|||||||
"""Create a new unconfigured bot."""
|
"""Create a new unconfigured bot."""
|
||||||
return Bot(self.get_unconfigured_account())
|
return Bot(self.get_unconfigured_account())
|
||||||
|
|
||||||
def get_credentials(self) -> (str, str):
|
def get_credentials(self) -> tuple[str, str]:
|
||||||
"""Generate new credentials for chatmail account."""
|
"""Generate new credentials for chatmail account."""
|
||||||
domain = os.environ["CHATMAIL_DOMAIN"]
|
domain = os.environ["CHATMAIL_DOMAIN"]
|
||||||
username = "ci-" + "".join(random.choice("2345789acdefghjkmnpqrstuvwxyz") for i in range(6))
|
username = "ci-" + "".join(random.choice("2345789acdefghjkmnpqrstuvwxyz") for i in range(6))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from deltachat_rpc_client import Account, EventType, const
|
from deltachat_rpc_client import EventType, const
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from deltachat_rpc_client.pytestplugin import RPCAccountFactory
|
from deltachat_rpc_client.pytestplugin import RPCAccountFactory
|
||||||
@@ -144,7 +144,7 @@ def test_download_on_demand(acf: RPCAccountFactory, rpcdata) -> None:
|
|||||||
wait_for_chatlist_specific_item(alice, chat_id)
|
wait_for_chatlist_specific_item(alice, chat_id)
|
||||||
|
|
||||||
|
|
||||||
def get_multi_account_test_setup(acf: RPCAccountFactory) -> [Account, Account, Account]:
|
def get_multi_account_test_setup(acf: RPCAccountFactory) -> list:
|
||||||
alice, bob = acf.get_online_accounts(2)
|
alice, bob = acf.get_online_accounts(2)
|
||||||
|
|
||||||
alice_contact_bob = alice.create_contact(bob, "Bob")
|
alice_contact_bob = alice.create_contact(bob, "Bob")
|
||||||
|
|||||||
Reference in New Issue
Block a user