1+ from http import HTTPStatus
2+
13import pytest
24
35from mpt_api_client .exceptions import MPTAPIError
6+ from mpt_api_client .resources .helpdesk .channels import Channel
47
5- pytestmark = [pytest .mark .flaky ]
8+ pytestmark = [pytest .mark .flaky , pytest . mark . skip ( reason = "Unskip after MPT-19124 completed" ) ]
69
710
8- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
911async def test_get_channel (async_mpt_ops , channel_id ):
1012 service = async_mpt_ops .helpdesk .channels
1113
@@ -14,23 +16,20 @@ async def test_get_channel(async_mpt_ops, channel_id):
1416 assert result .id == channel_id
1517
1618
17- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
1819async def test_list_channels (async_mpt_ops ):
1920 service = async_mpt_ops .helpdesk .channels
2021
2122 result = await service .fetch_page (limit = 1 )
2223
23- assert len ( result ) > 0
24+ assert all ( isinstance ( channel , Channel ) for channel in result )
2425
2526
26- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
2727def test_create_channel (async_created_channel ):
2828 result = async_created_channel
2929
3030 assert result .id is not None
3131
3232
33- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
3433async def test_update_channel (async_mpt_ops , async_created_channel , short_uuid ):
3534 service = async_mpt_ops .helpdesk .channels
3635 new_name = f"E2E Updated Channel { short_uuid } "
@@ -41,7 +40,6 @@ async def test_update_channel(async_mpt_ops, async_created_channel, short_uuid):
4140 assert result .to_dict ().get ("name" ) == new_name
4241
4342
44- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
4543async def test_delete_channel (async_mpt_ops , async_created_channel ):
4644 result = async_created_channel
4745
@@ -51,5 +49,6 @@ async def test_delete_channel(async_mpt_ops, async_created_channel):
5149async def test_not_found (async_mpt_ops , invalid_channel_id ):
5250 service = async_mpt_ops .helpdesk .channels
5351
54- with pytest .raises (MPTAPIError ):
52+ with pytest .raises (MPTAPIError ) as error :
5553 await service .get (invalid_channel_id )
54+ assert error .value .status_code == HTTPStatus .NOT_FOUND
0 commit comments