-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_async_cases.py
More file actions
71 lines (42 loc) · 2.26 KB
/
test_async_cases.py
File metadata and controls
71 lines (42 loc) · 2.26 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import pytest
from mpt_api_client.exceptions import MPTAPIError
pytestmark = [pytest.mark.flaky]
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_get_case(async_mpt_ops, async_created_case):
result = await async_mpt_ops.helpdesk.cases.get(async_created_case.id)
assert result.id == async_created_case.id
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_list_cases(async_mpt_ops):
limit = 1
result = await async_mpt_ops.helpdesk.cases.fetch_page(limit=limit)
assert len(result) > 0
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
def test_create_case(async_created_case):
result = async_created_case
assert result is not None
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_update_case(async_mpt_ops, async_created_case, short_uuid):
update_data = {"description": f"e2e update {short_uuid}"}
result = await async_mpt_ops.helpdesk.cases.update(async_created_case.id, update_data)
assert result.id == async_created_case.id
assert result.to_dict().get("description") == update_data["description"]
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_process_case(async_mpt_ops, async_created_case):
result = await async_mpt_ops.helpdesk.cases.process(async_created_case.id)
assert result is not None
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_query_case(async_mpt_ops, async_created_case):
processed_case = await async_mpt_ops.helpdesk.cases.process(async_created_case.id)
result = await async_mpt_ops.helpdesk.cases.query(
processed_case.id, {"queryPrompt": "Could you provide more details?"}
)
assert result is not None
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_complete_case(async_mpt_ops, async_created_case):
processed_case = await async_mpt_ops.helpdesk.cases.process(async_created_case.id)
result = await async_mpt_ops.helpdesk.cases.complete(processed_case.id)
assert result is not None
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_not_found(async_mpt_ops, invalid_case_id):
with pytest.raises(MPTAPIError):
await async_mpt_ops.helpdesk.cases.get(invalid_case_id)