-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_sync_parameters.py
More file actions
35 lines (21 loc) · 1 KB
/
test_sync_parameters.py
File metadata and controls
35 lines (21 loc) · 1 KB
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
from http import HTTPStatus
import pytest
from mpt_api_client.exceptions import MPTAPIError
from mpt_api_client.resources.helpdesk.chat_answer_parameters import ChatAnswerParameter
pytestmark = [
pytest.mark.flaky,
pytest.mark.skip(reason="Unskip after MPT-19124 completed"),
]
def test_list_chat_answer_parameters(chat_answer_parameters_service):
result = chat_answer_parameters_service.fetch_page(limit=20)
assert len(result) > 0
assert all(isinstance(parameter, ChatAnswerParameter) for parameter in result)
def test_iterate_chat_answer_parameters(chat_answer_parameters_service):
iterator = chat_answer_parameters_service.iterate(limit=20)
result = next(iterator, None)
assert isinstance(result, ChatAnswerParameter)
def test_not_found(mpt_ops, chat_id):
service = mpt_ops.helpdesk.chats.answers(chat_id).parameters("ANS-0000-0000")
with pytest.raises(MPTAPIError) as error:
service.fetch_page(limit=20)
assert error.value.status_code == HTTPStatus.NOT_FOUND