fastmcp/tests/server/tasks
Jeremiah Lowin d6654a2379
Add supports_tasks() method to replace string mode checks (#2664)
* Add supports_tasks() method to replace string mode checks

Consolidates task config mode checks into a readable method on TaskConfig.
Instead of `task_config.mode == "forbidden"` or `task_config.mode != "forbidden"`,
code now uses `task_config.supports_tasks()` for clearer intent.

Updated 20 instances across the codebase and added type assertions in tests
to resolve type checker warnings.

* Update test to match new error message
2025-12-21 15:41:46 -05:00
..
__init__.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
conftest.py Remove enable_tasks setting, enable task protocol by default 2025-12-09 09:34:42 -05:00
test_custom_subclass_tasks.py Add supports_tasks() method to replace string mode checks (#2664) 2025-12-21 15:41:46 -05:00
test_progress_dependency.py Remove enable_docket setting; Docket is now always on 2025-12-05 11:40:04 -05:00
test_server_tasks_parameter.py Simplify .key as computed property (#2648) 2025-12-18 14:48:47 -05:00
test_sync_function_task_disabled.py Add TaskConfig for SEP-1686 execution modes 2025-12-06 21:01:11 -05:00
test_task_capabilities.py Centralize task capabilities, add component filtering 2025-12-09 10:02:38 -05:00
test_task_config_modes.py Use CreateTaskResult for background task creation (#2660) 2025-12-20 20:19:11 -05:00
test_task_dependencies.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_task_metadata.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_task_methods.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_task_mount.py Refactor provider execution: components own their execution (#2663) 2025-12-21 15:03:24 -05:00
test_task_prompts.py Add TaskConfig for SEP-1686 execution modes 2025-12-06 21:01:11 -05:00
test_task_protocol.py Remove enable_tasks setting, enable task protocol by default 2025-12-09 09:34:42 -05:00
test_task_proxy.py Proxy tasks forbidden, mount tasks working 2025-12-08 11:44:28 -05:00
test_task_resources.py Add TaskConfig for SEP-1686 execution modes 2025-12-06 21:01:11 -05:00
test_task_return_types.py [SEP-1686] Raise ValueError when sync functions have task=True (#2554) 2025-12-05 11:31:28 -05:00
test_task_security.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_task_status_notifications.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_task_tools.py Add TaskConfig for SEP-1686 execution modes 2025-12-06 21:01:11 -05:00
test_task_ttl.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00