Skip to content

test(mcp_server): add unit tests for pure helpers (utils/selection/providers) - #18389

Closed
Jay0130-a wants to merge 1 commit into
PaddlePaddle:mainfrom
Jay0130-a:test/mcp-server-pure-helpers
Closed

Jay0130-a wants to merge 1 commit into
PaddlePaddle:mainfrom
Jay0130-a:test/mcp-server-pure-helpers

Conversation

@Jay0130-a

Copy link
Copy Markdown

Summary

The paddleocr_mcp package (the PaddleOCR MCP server used by AI agents / tool-calling apps) had no unit tests. This adds the package's first tests, covering the dependency-free pure helpers so they can be validated quickly and cheaply.

New files under mcp_server/tests/:

  • test_utils.py — is_url, is_base64, extract_base64_payload, decode_base64_payload (URL scheme/host checks, data-URL payload extraction, and Base64 decode error handling).
  • test_selection.py — resolve_model (default fallback, whitespace trimming, unsupported-model rejection, qianfan-specific model constraints), tool_for_model, and registry invariants (DEFAULT_MODEL/QIANFAN_SUPPORTED_MODELS subsets).
  • test_providers.py — normalize_provider, get_provider_spec transports, http_providers, is_http_provider, provider_choices.

Test plan

  • python -m pytest mcp_server/tests → 37 passed (verified locally, Python 3.11). No network or model/inference dependencies; only stdlib + pytest.

…oviders)

The paddleocr_mcp package had no unit tests. Add mcp_server/tests covering the dependency-free pure helpers: utils (is_url/is_base64/extract_base64_payload/decode_base64_payload), selection (resolve_model defaulting/stripping/validation + qianfan constraints, tool_for_model, model registries) and providers (normalize_provider, provider specs/transports, http_providers, provider_choices). 37 deterministic tests; no network or model dependencies.
@CLAassistant

CLAassistant commented Oct 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Jay0130-a

Copy link
Copy Markdown
Author

Closing to keep the review queue focused. The change is still on the branch and can be reopened on request if it is useful.

@Jay0130-a Jay0130-a closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants