-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_sync_chats.py
More file actions
38 lines (21 loc) · 853 Bytes
/
test_sync_chats.py
File metadata and controls
38 lines (21 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pytest
from mpt_api_client.exceptions import MPTAPIError
pytestmark = [pytest.mark.flaky]
def test_get_chat(mpt_ops, chat_id):
service = mpt_ops.helpdesk.chats
result = service.get(chat_id)
assert result.id == chat_id
def test_list_chats(mpt_ops):
service = mpt_ops.helpdesk.chats
result = service.fetch_page(limit=1)
assert len(result) > 0
def test_update_chat(mpt_ops, chat_id, short_uuid):
service = mpt_ops.helpdesk.chats
new_description = f"e2e update {short_uuid}"
result = service.update(chat_id, {"description": new_description})
assert result.id == chat_id
assert result.to_dict().get("description") == new_description
def test_not_found(mpt_ops, invalid_chat_id):
service = mpt_ops.helpdesk.chats
with pytest.raises(MPTAPIError):
service.get(invalid_chat_id)