dify/api/tests
Taranum01 dcdca603e7 fix(plugin): fall back to generic listing when category route 404s
Fixes #40683

`PluginInstaller.list_plugins_by_category` calls
`GET /plugin/{tenant_id}/management/{category}/list` on the plugin
daemon. Local plugin daemons (e.g. 0.6.x) don't expose the
category-segmented route and return 404. The current code raises
this 404, which then breaks the model-provider integration page
even though the generic listing route is available.

On 404, fall back to
`GET /plugin/{tenant_id}/management/list` and filter the result
locally by `declaration.category`. The generic route is the same
one used by the unrestricted `list_plugins_with_total`. Apply the
caller's page/page_size on the filtered result (cap page_size at
1000 for the fallback fetch — adequate for any reasonable category).

Added a regression test in `test_plugin_manager.py` that
asserts the 404-fallback path produces the correct filtered list
with the right `has_more` flag.
2026-08-14 23:21:31 +05:30
..
fixtures/workflow chore(api): Upgrade graphon to v0.5.1 (#37168) 2026-06-11 07:37:27 +00:00
helpers chore: port isinstance to match case (#37271) 2026-06-18 00:18:03 +00:00
integration_tests refactor(api): consolidate deployment edition handling (#40142) 2026-08-11 07:39:01 +00:00
test_containers_integration_tests fix: reclaim conversation resources on deletion (#40792) 2026-08-14 14:30:04 +00:00
unit_tests fix(plugin): fall back to generic listing when category route 404s 2026-08-14 23:21:31 +05:30
__init__.py refactor: move vdb implementations to workspaces (#34900) 2026-04-13 08:56:43 +00:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
pytest_dify.py test(api): manage backend pytest services natively (#36235) 2026-05-19 07:52:15 +00:00
seed_legacy_model_type_dirty_data.py feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
workflow_test_utils.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00