mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 20:06:30 +03:00
update python (does not work yet)
I get a few errors: ``` FAILED tests/test_chatlist_events.py::test_delivery_status - AttributeError: 'dict' object has no attribute 'kind' FAILED tests/test_chatlist_events.py::test_delivery_status_failed - AttributeError: 'dict' object has no attribute 'kind' FAILED tests/test_chatlist_events.py::test_multidevice_sync_chat - AttributeError: 'dict' object has no attribute 'kind' FAILED tests/test_chatlist_events.py::test_download_on_demand - AttributeError: 'dict' object has no attribute 'kind' FAILED tests/test_chatlist_events.py::test_imap_sync_seen_msgs - AttributeError: 'dict' object has no attribute 'kind' ```
This commit is contained in:
@@ -61,6 +61,7 @@ class EventType(str, Enum):
|
|||||||
WEBXDC_INSTANCE_DELETED = "WebxdcInstanceDeleted"
|
WEBXDC_INSTANCE_DELETED = "WebxdcInstanceDeleted"
|
||||||
CHATLIST_CHANGED = "ChatlistChanged"
|
CHATLIST_CHANGED = "ChatlistChanged"
|
||||||
CHATLIST_ITEM_CHANGED = "ChatlistItemChanged"
|
CHATLIST_ITEM_CHANGED = "ChatlistItemChanged"
|
||||||
|
TEST_CHECKPOINT_EVENT = "TestCheckpointEvent"
|
||||||
|
|
||||||
|
|
||||||
class ChatId(IntEnum):
|
class ChatId(IntEnum):
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from queue import Empty, Queue
|
from queue import Queue
|
||||||
from threading import Event, Thread
|
from threading import Event, Thread
|
||||||
from typing import Any, Iterator, Optional
|
from typing import Any, Iterator, Optional
|
||||||
|
|
||||||
|
from .const import EventType
|
||||||
|
|
||||||
|
|
||||||
class JsonRpcError(Exception):
|
class JsonRpcError(Exception):
|
||||||
pass
|
pass
|
||||||
@@ -190,12 +192,11 @@ class Rpc:
|
|||||||
|
|
||||||
def clear_all_events(self, account_id: int):
|
def clear_all_events(self, account_id: int):
|
||||||
"""Removes all queued-up events for a given account. Useful for tests."""
|
"""Removes all queued-up events for a given account. Useful for tests."""
|
||||||
queue = self.get_queue(account_id)
|
id = self.trigger_checkpoint_event(account_id)
|
||||||
try:
|
while True:
|
||||||
while True:
|
event = self.wait_for_event(account_id)
|
||||||
queue.get_nowait()
|
if event.kind == EventType.TEST_CHECKPOINT_EVENT and event.id == id:
|
||||||
except Empty:
|
break
|
||||||
pass
|
|
||||||
|
|
||||||
def __getattr__(self, attr: str):
|
def __getattr__(self, attr: str):
|
||||||
return RpcMethod(self, attr)
|
return RpcMethod(self, attr)
|
||||||
|
|||||||
Reference in New Issue
Block a user