|
| 1 | +import pytest |
| 2 | + |
| 3 | +from mpt_api_client.resources.helpdesk.chat_participants import ( |
| 4 | + AsyncChatParticipantsService, |
| 5 | + ChatParticipantsService, |
| 6 | +) |
| 7 | + |
| 8 | + |
| 9 | +@pytest.fixture |
| 10 | +def chat_participants_service(http_client) -> ChatParticipantsService: |
| 11 | + return ChatParticipantsService( |
| 12 | + http_client=http_client, endpoint_params={"chat_id": "CHT-0000-0000-0001"} |
| 13 | + ) |
| 14 | + |
| 15 | + |
| 16 | +@pytest.fixture |
| 17 | +def async_chat_participants_service(async_http_client) -> AsyncChatParticipantsService: |
| 18 | + return AsyncChatParticipantsService( |
| 19 | + http_client=async_http_client, endpoint_params={"chat_id": "CHT-0000-0000-0001"} |
| 20 | + ) |
| 21 | + |
| 22 | + |
| 23 | +def test_endpoint(chat_participants_service) -> None: |
| 24 | + result = ( |
| 25 | + chat_participants_service.path |
| 26 | + == "/public/v1/helpdesk/chats/CHT-0000-0000-0001/participants" |
| 27 | + ) |
| 28 | + |
| 29 | + assert result is True |
| 30 | + |
| 31 | + |
| 32 | +def test_async_endpoint(async_chat_participants_service) -> None: |
| 33 | + result = ( |
| 34 | + async_chat_participants_service.path |
| 35 | + == "/public/v1/helpdesk/chats/CHT-0000-0000-0001/participants" |
| 36 | + ) |
| 37 | + |
| 38 | + assert result is True |
| 39 | + |
| 40 | + |
| 41 | +@pytest.mark.parametrize("method", ["create", "update", "delete", "iterate"]) |
| 42 | +def test_methods_present(chat_participants_service, method: str) -> None: |
| 43 | + result = hasattr(chat_participants_service, method) |
| 44 | + |
| 45 | + assert result is True |
| 46 | + |
| 47 | + |
| 48 | +@pytest.mark.parametrize("method", ["create", "update", "delete", "iterate"]) |
| 49 | +def test_async_methods_present(async_chat_participants_service, method: str) -> None: |
| 50 | + result = hasattr(async_chat_participants_service, method) |
| 51 | + |
| 52 | + assert result is True |
0 commit comments