mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36: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"
|
||||
CHATLIST_CHANGED = "ChatlistChanged"
|
||||
CHATLIST_ITEM_CHANGED = "ChatlistItemChanged"
|
||||
TEST_CHECKPOINT_EVENT = "TestCheckpointEvent"
|
||||
|
||||
|
||||
class ChatId(IntEnum):
|
||||
|
||||
@@ -6,10 +6,12 @@ import logging
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from queue import Empty, Queue
|
||||
from queue import Queue
|
||||
from threading import Event, Thread
|
||||
from typing import Any, Iterator, Optional
|
||||
|
||||
from .const import EventType
|
||||
|
||||
|
||||
class JsonRpcError(Exception):
|
||||
pass
|
||||
@@ -190,12 +192,11 @@ class Rpc:
|
||||
|
||||
def clear_all_events(self, account_id: int):
|
||||
"""Removes all queued-up events for a given account. Useful for tests."""
|
||||
queue = self.get_queue(account_id)
|
||||
try:
|
||||
while True:
|
||||
queue.get_nowait()
|
||||
except Empty:
|
||||
pass
|
||||
id = self.trigger_checkpoint_event(account_id)
|
||||
while True:
|
||||
event = self.wait_for_event(account_id)
|
||||
if event.kind == EventType.TEST_CHECKPOINT_EVENT and event.id == id:
|
||||
break
|
||||
|
||||
def __getattr__(self, attr: str):
|
||||
return RpcMethod(self, attr)
|
||||
|
||||
Reference in New Issue
Block a user