|
| 1 | +import pytest |
| 2 | + |
| 3 | +from mpt_api_client.exceptions import MPTAPIError |
| 4 | + |
| 5 | +pytestmark = [pytest.mark.flaky] |
| 6 | + |
| 7 | + |
| 8 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") |
| 9 | +async def test_list_chat_participants(async_chat_participants_service): |
| 10 | + result = await async_chat_participants_service.fetch_page(limit=1) |
| 11 | + |
| 12 | + assert len(result) > 0 |
| 13 | + |
| 14 | + |
| 15 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") # noqa: AAA01 |
| 16 | +def test_create_chat_participant(async_created_chat_participant): |
| 17 | + assert async_created_chat_participant.id is not None |
| 18 | + |
| 19 | + |
| 20 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") |
| 21 | +async def test_update_chat_participant( |
| 22 | + async_chat_participants_service, async_created_chat_participant |
| 23 | +): |
| 24 | + result = await async_chat_participants_service.update( |
| 25 | + async_created_chat_participant.id, |
| 26 | + {"status": "Active"}, |
| 27 | + ) |
| 28 | + |
| 29 | + assert result.id == async_created_chat_participant.id |
| 30 | + |
| 31 | + |
| 32 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") |
| 33 | +async def test_delete_chat_participant( |
| 34 | + async_chat_participants_service, async_created_chat_participant |
| 35 | +): |
| 36 | + result = async_created_chat_participant |
| 37 | + |
| 38 | + await async_chat_participants_service.delete(result.id) |
| 39 | + |
| 40 | + |
| 41 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") |
| 42 | +async def test_update_chat_participant_not_found( |
| 43 | + async_chat_participants_service, invalid_chat_participant_id |
| 44 | +): |
| 45 | + with pytest.raises(MPTAPIError, match=r"404 Not Found"): |
| 46 | + await async_chat_participants_service.update( |
| 47 | + invalid_chat_participant_id, |
| 48 | + {"status": "Active"}, |
| 49 | + ) |
| 50 | + |
| 51 | + |
| 52 | +@pytest.mark.skip(reason="Unskip after MPT-19124 completed") |
| 53 | +async def test_delete_chat_participant_not_found( |
| 54 | + async_chat_participants_service, invalid_chat_participant_id |
| 55 | +): |
| 56 | + with pytest.raises(MPTAPIError, match=r"404 Not Found"): |
| 57 | + await async_chat_participants_service.delete(invalid_chat_participant_id) |
0 commit comments