lundberg / respx

Mock HTTPX with awesome request patterns and response side effects 🦋
https://lundberg.github.io/respx
BSD 3-Clause "New" or "Revised" License
581 stars 38 forks source link

Fix matching request data when files are provided #252

Closed lundberg closed 4 months ago

lundberg commented 4 months ago

When posting data with httpx along with files, the request body gets encoded as multipart form-data. This PR adds support for matching request data even if files are included in the actual request.

As a bonus feature, the data pattern gets support for the contains lookup. The eq lookup is kept as default for now, but will probably be changed to contains in the future.

Fixes #251

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (58ad17e) to head (78d8e8a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #252 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 20 21 +1 Lines 2759 2807 +48 Branches 418 423 +5 ========================================= + Hits 2759 2807 +48 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.