MPT-18930 Add helpdesk channel API services and test coverage#248
MPT-18930 Add helpdesk channel API services and test coverage#248
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/helpdesk/channels/test_async_channels.py (1)
51-55: Consider addingmatchparameter for consistency with sync tests.The sync counterpart in
test_sync_channels.pyusespytest.raises(MPTAPIError)without a match, buttest_sync_messages.pyusesmatch=r"404 Not Found". Consider aligning error assertion patterns across all E2E tests for consistency—either all usematchor none do.♻️ Optional: Add match parameter for more specific error validation
async def test_not_found(async_mpt_ops, invalid_channel_id): service = async_mpt_ops.helpdesk.channels - with pytest.raises(MPTAPIError): + with pytest.raises(MPTAPIError, match=r"404"): await service.get(invalid_channel_id)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/helpdesk/channels/test_async_channels.py` around lines 51 - 55, Update the async test_not_found to assert the specific 404 error string like the other message tests: when calling service.get(invalid_channel_id) inside pytest.raises(MPTAPIError) add match=r"404 Not Found" so the test uses a precise error-match (refer to test_not_found, service.get, and pytest.raises).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/e2e/helpdesk/channels/test_async_channels.py`:
- Around line 51-55: Update the async test_not_found to assert the specific 404
error string like the other message tests: when calling
service.get(invalid_channel_id) inside pytest.raises(MPTAPIError) add
match=r"404 Not Found" so the test uses a precise error-match (refer to
test_not_found, service.get, and pytest.raises).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: ba54a0a8-41df-43ba-93f8-5553716fd89d
📒 Files selected for processing (12)
mpt_api_client/resources/helpdesk/channel_messages.pympt_api_client/resources/helpdesk/channels.pympt_api_client/resources/helpdesk/helpdesk.pytests/e2e/helpdesk/channels/conftest.pytests/e2e/helpdesk/channels/messages/conftest.pytests/e2e/helpdesk/channels/messages/test_async_messages.pytests/e2e/helpdesk/channels/messages/test_sync_messages.pytests/e2e/helpdesk/channels/test_async_channels.pytests/e2e/helpdesk/channels/test_sync_channels.pytests/unit/resources/helpdesk/test_channel_messages.pytests/unit/resources/helpdesk/test_channels.pytests/unit/resources/helpdesk/test_helpdesk.py



Summary
Helpdesk.channelsandAsyncHelpdesk.channelsservice accessors/public/v1/helpdesk/channelswith create/get/update/delete/list support/public/v1/helpdesk/channels/{channel_id}/messageswith collection-only accessTesting
uv run pytest tests/unit/resources/helpdesk/test_helpdesk.py tests/unit/resources/helpdesk/test_channels.py tests/unit/resources/helpdesk/test_channel_messages.pymake check-allCloses MPT-18930
Release Notes
Helpdesk.channelsandAsyncHelpdesk.channelsservice accessors to provide access to channel management functionality/public/v1/helpdesk/channelswith full CRUD operations (create, get, update, delete) and list/iteration support/public/v1/helpdesk/channels/{channel_id}/messageswith read-only access (fetch_page, iterate)Channelmodel class for channel resource representationmake check-all