fastmcp/tests/utilities
Jeremiah Lowin caeaa86394
Simplify .key as computed property (#2648)
* Simplify .key as computed property

Keep .key as the standard lookup interface for all components but
implement it as a computed property instead of a stored field.

- Remove _key private attribute and custom model_copy(key=...)
- .key returns .name for tools/prompts, str(.uri) for resources,
  .uri_template for templates
- Use .key universally for component lookups in managers
- MountedProvider: prefix URIs only for resources/templates, not names
- Docket registration: tools/prompts use .key, resources use .name
  (matches fn.__name__ for function lookup)

* Simplify .key as computed property

Keep .key as the standard lookup interface for all components but
implement it as a computed property instead of a stored field.

- Remove _key private attribute and custom model_copy(key=...)
- .key returns .name for tools/prompts, str(.uri) for resources,
  .uri_template for templates
- Use .key universally for component lookups and Docket registration
- MountedProvider: prefix URIs only for resources/templates, not names
- Add _backend_* fields to proxy classes to preserve original identifiers
  for backend calls when prefixed via import_server

* Standardize .key as computed property

- .key is now a read-only computed property:
  - Tools/Prompts: returns .name
  - Resources: returns str(.uri)
  - Templates: returns .uri_template
- Prefixing uses model_copy(update={...}) to change underlying field
- Resource/template names are NOT prefixed, only URIs
- Move import_server tests to tests/deprecated/
2025-12-18 14:48:47 -05:00
..
openapi Switch to new OpenAPI parser as default (#2513) 2025-12-01 20:29:18 -05:00
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_cli.py Fix path resolution in install commands (#1951) 2025-09-29 20:04:12 -04:00
test_components.py Simplify .key as computed property (#2648) 2025-12-18 14:48:47 -05:00
test_inspect.py Add "High Value" Ruff Rules (#2255) 2025-10-26 10:20:31 -04:00
test_json_schema.py Fix: Remove JSON schema title metadata while preserving parameters named 'title' (#1872) 2025-09-23 10:19:34 -04:00
test_json_schema_type.py Fix type errors for ty 0.0.1-alpha.31 upgrade (#2561) 2025-12-05 21:29:14 -05:00
test_logging.py Fix duplicate keyword argument error in configure_logging (#2381) 2025-11-06 10:11:16 -05:00
test_tests.py Remove open-ended and server-specific settings 2025-06-07 20:20:04 -04:00
test_typeadapter.py Fix method-bound tools (#1360) 2025-08-04 09:41:05 -04:00
test_types.py Fix: Include signature modification in create_function_without_params (#2563) 2025-12-06 11:57:36 -05:00