|
1 | 1 | import pytest |
2 | 2 |
|
| 3 | +from mpt_api_client.resources.helpdesk.chat_links import ( |
| 4 | + AsyncChatLinksService, |
| 5 | + ChatLinksService, |
| 6 | +) |
3 | 7 | from mpt_api_client.resources.helpdesk.chat_messages import ( |
4 | 8 | AsyncChatMessagesService, |
5 | 9 | ChatMessagesService, |
@@ -37,15 +41,29 @@ def test_async_mixins_present(async_chats_service, method): |
37 | 41 | assert result is True |
38 | 42 |
|
39 | 43 |
|
40 | | -def test_messages_service(chats_service): |
41 | | - result = chats_service.messages("CHT-0000-0000-0001") |
| 44 | +@pytest.mark.parametrize( |
| 45 | + ("service_method", "expected_service_class"), |
| 46 | + [ |
| 47 | + ("messages", ChatMessagesService), |
| 48 | + ("links", ChatLinksService), |
| 49 | + ], |
| 50 | +) |
| 51 | +def test_property_services(chats_service, service_method, expected_service_class): |
| 52 | + result = getattr(chats_service, service_method)("CHT-0000-0000-0001") |
42 | 53 |
|
43 | | - assert isinstance(result, ChatMessagesService) |
| 54 | + assert isinstance(result, expected_service_class) |
44 | 55 | assert result.endpoint_params == {"chat_id": "CHT-0000-0000-0001"} |
45 | 56 |
|
46 | 57 |
|
47 | | -def test_async_messages_service(async_chats_service): |
48 | | - result = async_chats_service.messages("CHT-0000-0000-0001") |
| 58 | +@pytest.mark.parametrize( |
| 59 | + ("service_method", "expected_service_class"), |
| 60 | + [ |
| 61 | + ("messages", AsyncChatMessagesService), |
| 62 | + ("links", AsyncChatLinksService), |
| 63 | + ], |
| 64 | +) |
| 65 | +def test_async_property_services(async_chats_service, service_method, expected_service_class): |
| 66 | + result = getattr(async_chats_service, service_method)("CHT-0000-0000-0001") |
49 | 67 |
|
50 | | - assert isinstance(result, AsyncChatMessagesService) |
| 68 | + assert isinstance(result, expected_service_class) |
51 | 69 | assert result.endpoint_params == {"chat_id": "CHT-0000-0000-0001"} |
0 commit comments