[PR #32058] fix: correct mock return type in CodeBasedExtension test #33528

Open
opened 2026-02-21 20:53:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32058

State: open
Merged: No


Summary

  • Fix test_code_based_extension_get_returns_service_data to mock CodeBasedExtensionService.get_code_based_extension with a list[dict] instead of a plain dict, matching the actual service return type.

Fixes #31864

Test plan

  • Verified the actual service (api/services/code_based_extension_service.py) returns a list comprehension (list[dict])
  • Updated mock return value from {"entrypoint": "main:agent"} to [{"entrypoint": "main:agent"}]
  • Assertion already references service_result by variable, so it automatically validates the correct type
  • Pre-commit hooks (Ruff linter) pass
**Original Pull Request:** https://github.com/langgenius/dify/pull/32058 **State:** open **Merged:** No --- ## Summary - Fix `test_code_based_extension_get_returns_service_data` to mock `CodeBasedExtensionService.get_code_based_extension` with a `list[dict]` instead of a plain `dict`, matching the actual service return type. Fixes #31864 ## Test plan - [x] Verified the actual service (`api/services/code_based_extension_service.py`) returns a list comprehension (`list[dict]`) - [x] Updated mock return value from `{"entrypoint": "main:agent"}` to `[{"entrypoint": "main:agent"}]` - [x] Assertion already references `service_result` by variable, so it automatically validates the correct type - [x] Pre-commit hooks (Ruff linter) pass
yindo added the pull-request label 2026-02-21 20:53:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33528