test: add pytest coverage for SSE transport functions #557
+12
−1
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.
Added a new pytest function,
test_remove_request_params
, intests/shared/test_sse.py
to cover the previously untestedremove_request_params
utility in the SSE client module.Motivation and Context
The
remove_request_params
function insrc/mcp/client/sse.py
was not directly tested, leaving potential edge cases unverified. By adding a focused unit test, we ensure that:This aligns the SSE client tests with the project’s coverage standards and closes gaps in our automated test suite.
How Has This Been Tested?
pytest tests/shared/test_sse.py
locally, confirming:http://example.com/path?foo=bar#baz
are normalized tohttp://example.com/path
.https://mcp.dev/stream
) pass through untouched.pytest
) to verify no regressions.Breaking Changes
None. This update only adds tests and does not alter library behavior or public APIs.
Types of changes
Checklist
Additional context
This change brings the SSE client’s test coverage to 100% for its public utilities and contributes to overall library reliability.