Skip to content

Commit 0ccaf4c

Browse files
committed
test(helpdesk): add TODOs and FIXMEs for improving e2e assertions
1 parent 59d7853 commit 0ccaf4c

31 files changed

Lines changed: 70 additions & 60 deletions

e2e_config.test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"commerce.product.template.id": "TPL-1767-7355-0002",
5858
"commerce.user.id": "USR-4303-2348",
5959
"helpdesk.chat.id": "CHT-5064-0262-3671",
60+
"helpdesk.channel.id": "CHL-5064-0262-3671",
6061
"commerce.subscription.agreement.id": "AGR-2473-3299-1721",
6162
"commerce.subscription.id": "SUB-3678-1831-2188",
6263
"commerce.subscription.product.item.id": "ITM-1767-7355-0001",

tests/e2e/helpdesk/cases/test_async_cases.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ async def test_get_case(async_mpt_ops, async_created_case):
1212
assert result.id == async_created_case.id
1313

1414

15-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1615
async def test_list_cases(async_mpt_ops):
1716
limit = 1
1817

1918
result = await async_mpt_ops.helpdesk.cases.fetch_page(limit=limit)
2019

21-
assert len(result) > 0
20+
assert len(result) > 0 # TODO: do more specific check
2221

2322

2423
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
@@ -65,7 +64,6 @@ async def test_complete_case(async_mpt_ops, async_created_case):
6564
assert result is not None
6665

6766

68-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
6967
async def test_not_found(async_mpt_ops, invalid_case_id):
70-
with pytest.raises(MPTAPIError):
68+
with pytest.raises(MPTAPIError): # FIXME: should specifically check for not found
7169
await async_mpt_ops.helpdesk.cases.get(invalid_case_id)

tests/e2e/helpdesk/cases/test_sync_cases.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ def test_get_case(mpt_ops, created_case):
1212
assert result.id == created_case.id
1313

1414

15-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1615
def test_list_cases(mpt_ops):
1716
limit = 1
1817

1918
result = mpt_ops.helpdesk.cases.fetch_page(limit=limit)
2019

21-
assert len(result) > 0
20+
assert len(result) > 0 # TODO: do more specific check
2221

2322

2423
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
@@ -65,7 +64,6 @@ def test_complete_case(mpt_ops, created_case):
6564
assert result is not None
6665

6766

68-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
6967
def test_not_found(mpt_ops, invalid_case_id):
70-
with pytest.raises(MPTAPIError):
68+
with pytest.raises(MPTAPIError): # FIXME: should specifically check for not found
7169
mpt_ops.helpdesk.cases.get(invalid_case_id)

tests/e2e/helpdesk/channels/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@pytest.fixture
1010
def channel_id(e2e_config):
11-
return e2e_config["helpdesk.channel.id"]
11+
return e2e_config["helpdesk.channel.id"] # FIXME: seed data
1212

1313

1414
@pytest.fixture
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

tests/e2e/helpdesk/channels/messages/test_async_messages.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
async def test_list_channel_messages(async_channel_messages_service):
1010
result = await async_channel_messages_service.fetch_page(limit=1)
1111

12-
assert len(result) > 0
12+
assert len(result) > 0 # TODO: do more specific check
1313

1414

1515
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1616
async def test_list_channel_messages_not_found(async_mpt_ops, invalid_channel_id):
17-
with pytest.raises(MPTAPIError, match=r"404 Not Found"):
17+
with pytest.raises(
18+
MPTAPIError, match=r"404 Not Found"
19+
): # FIXME: should specifically check for not found
1820
await async_mpt_ops.helpdesk.channels.messages(invalid_channel_id).fetch_page(limit=1)

tests/e2e/helpdesk/channels/messages/test_sync_messages.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
def test_list_channel_messages(channel_messages_service):
1010
result = channel_messages_service.fetch_page(limit=1)
1111

12-
assert len(result) > 0
12+
assert len(result) > 0 # TODO: do more specific check
1313

1414

1515
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1616
def test_list_channel_messages_not_found(mpt_ops, invalid_channel_id):
17-
with pytest.raises(MPTAPIError, match=r"404 Not Found"):
17+
with pytest.raises(
18+
MPTAPIError, match=r"404 Not Found"
19+
): # FIXME: should specifically check for not found
1820
mpt_ops.helpdesk.channels.messages(invalid_channel_id).fetch_page(limit=1)

tests/e2e/helpdesk/channels/test_async_channels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def test_list_channels(async_mpt_ops):
2020

2121
result = await service.fetch_page(limit=1)
2222

23-
assert len(result) > 0
23+
assert len(result) > 0 # TODO: do more specific check
2424

2525

2626
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
@@ -51,5 +51,5 @@ async def test_delete_channel(async_mpt_ops, async_created_channel):
5151
async def test_not_found(async_mpt_ops, invalid_channel_id):
5252
service = async_mpt_ops.helpdesk.channels
5353

54-
with pytest.raises(MPTAPIError):
54+
with pytest.raises(MPTAPIError): # FIXME: should specifically check for not found
5555
await service.get(invalid_channel_id)

tests/e2e/helpdesk/channels/test_sync_channels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_list_channels(mpt_ops):
2020

2121
result = service.fetch_page(limit=1)
2222

23-
assert len(result) > 0
23+
assert len(result) > 0 # TODO: do more specific check
2424

2525

2626
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
@@ -51,5 +51,5 @@ def test_delete_channel(mpt_ops, created_channel):
5151
def test_not_found(mpt_ops, invalid_channel_id):
5252
service = mpt_ops.helpdesk.channels
5353

54-
with pytest.raises(MPTAPIError):
54+
with pytest.raises(MPTAPIError): # FIXME: should specifically check for not found
5555
service.get(invalid_channel_id)

tests/e2e/helpdesk/chats/answers/parameters/test_async_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ async def test_iterate_chat_answer_parameters(async_chat_answer_parameters_servi
2424
async def test_not_found(async_mpt_ops, chat_id):
2525
service = async_mpt_ops.helpdesk.chats.answers(chat_id).parameters("ANS-0000-0000")
2626

27-
with pytest.raises(MPTAPIError):
27+
with pytest.raises(MPTAPIError): # FIXME: should specifically check for not found
2828
await service.fetch_page(limit=20)

0 commit comments

Comments
 (0)