feat!: add httpx + MCP adapters, restructure formats/protocols/http#27
Merged
Conversation
- Add httpx adapter (FluentResponse, RequestBuilder, FluentHttpAssertClient) - Add MCP protocol support (AssertableMCP, AssertableContent/Tools, MessageBuilder) - Restructure: pyssertive.formats/ (JSON, HTML), pyssertive.protocols/mcp/ (DSL), pyssertive.http/ (request, response, mcp transport, mixins) - Contract testing: parametrized cross-adapter tests in tests/adapters/test_*.py - CI: add test-cross-adapter job BREAKING CHANGES: - pyssertive.protocol.HttpResponseProtocol -> pyssertive.http.response.ResponseProtocol - pyssertive.request.* -> pyssertive.http.request.* - pyssertive.mcp.* split: protocols.mcp.* (DSL) + http.mcp.* (transport) - AssertableMCP(payload) constructor replaces assert_mcp() function - Removed: assert_see/dont_see/see_in_order, assert_json_is_object/array, AssertableToolCall.because_message_contains (alias)
|
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
FluentResponse,HttpxRequestBuilder,FluentHttpAssertClient) for FastAPI / Starlette / FastMCP testingAssertableMCP,AssertableContent,AssertableToolDef/List/Call,MessageBuilder) with MCP-native vocabularypyssertive.formats/(JSON, HTML),pyssertive.protocols/mcp/(DSL),pyssertive.http/(request, response, transport)test-cross-adapterCI job to validate both adapters cumple el mismo contratoBreaking changes
pyssertive.protocol.HttpResponseProtocol→pyssertive.http.response.ResponseProtocolpyssertive.request.*→pyssertive.http.request.*pyssertive.mcp.*split:pyssertive.protocols.mcp.*(DSL) +pyssertive.http.mcp.*(transport)AssertableMCP(payload)constructor replacesassert_mcp()function (auto-detects dict / bytes / str / SSE / HTTP response)AssertableJson(payload)andAssertableHtml(payload)constructors now accept bytes/str directly (auto-parse)assert_see,assert_dont_see,assert_see_in_order(use_html/_textvariants)assert_json_is_object,assert_json_is_array(use_dict/_list)AssertableToolCall.because_message_contains(alias ofwith_message_containing)Test plan