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,21 @@ 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
2324 assert len (result ) > 0
25+ assert all (isinstance (channel , Channel ) for channel in result )
2426
2527
26- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
2728def test_create_channel (async_created_channel ):
2829 result = async_created_channel
2930
3031 assert result .id is not None
3132
3233
33- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
3434async def test_update_channel (async_mpt_ops , async_created_channel , short_uuid ):
3535 service = async_mpt_ops .helpdesk .channels
3636 new_name = f"E2E Updated Channel { short_uuid } "
@@ -41,7 +41,6 @@ async def test_update_channel(async_mpt_ops, async_created_channel, short_uuid):
4141 assert result .to_dict ().get ("name" ) == new_name
4242
4343
44- @pytest .mark .skip (reason = "Unskip after MPT-19124 completed" )
4544async def test_delete_channel (async_mpt_ops , async_created_channel ):
4645 result = async_created_channel
4746
@@ -51,5 +50,6 @@ async def test_delete_channel(async_mpt_ops, async_created_channel):
5150async def test_not_found (async_mpt_ops , invalid_channel_id ):
5251 service = async_mpt_ops .helpdesk .channels
5352
54- with pytest .raises (MPTAPIError ):
53+ with pytest .raises (MPTAPIError ) as error :
5554 await service .get (invalid_channel_id )
55+ assert error .value .status_code == HTTPStatus .NOT_FOUND
0 commit comments