-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_helpdesk.py
More file actions
58 lines (43 loc) · 1.66 KB
/
test_helpdesk.py
File metadata and controls
58 lines (43 loc) · 1.66 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
import pytest
from mpt_api_client.resources.helpdesk import AsyncHelpdesk, Helpdesk
from mpt_api_client.resources.helpdesk.cases import AsyncCasesService, CasesService
from mpt_api_client.resources.helpdesk.chats import AsyncChatsService, ChatsService
from mpt_api_client.resources.helpdesk.parameters import (
AsyncParametersService,
ParametersService,
)
from mpt_api_client.resources.helpdesk.queues import AsyncQueuesService, QueuesService
def test_helpdesk_init(http_client):
result = Helpdesk(http_client=http_client)
assert isinstance(result, Helpdesk)
assert result.http_client is http_client
def test_async_helpdesk_init(async_http_client):
result = AsyncHelpdesk(http_client=async_http_client)
assert isinstance(result, AsyncHelpdesk)
assert result.http_client is async_http_client
@pytest.mark.parametrize(
("attr_name", "expected"),
[
("chats", ChatsService),
("cases", CasesService),
("queues", QueuesService),
("parameters", ParametersService),
],
)
def test_helpdesk_properties(http_client, attr_name, expected):
helpdesk = Helpdesk(http_client=http_client)
result = getattr(helpdesk, attr_name)
assert isinstance(result, expected)
@pytest.mark.parametrize(
("attr_name", "expected"),
[
("chats", AsyncChatsService),
("cases", AsyncCasesService),
("queues", AsyncQueuesService),
("parameters", AsyncParametersService),
],
)
def test_async_helpdesk_properties(async_http_client, attr_name, expected):
helpdesk = AsyncHelpdesk(http_client=async_http_client)
result = getattr(helpdesk, attr_name)
assert isinstance(result, expected)