Repository navigation
Conversation
…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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
paddleocr_mcppackage (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_MODELSsubsets).test_providers.py—normalize_provider,get_provider_spectransports,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.