Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files pattern #253

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Add files pattern #253

merged 2 commits into from
Mar 18, 2024

Conversation

lundberg
Copy link
Owner

@lundberg lundberg commented Mar 15, 2024

Add support for matching on file uploads.

Example:

respx.post("https://example.org/", files={"some_file": b"..."})
respx.post("https://example.org/", files={"some_file": ANY})
respx.post("https://example.org/", files={"some_file": ("filename.txt", b"...")})
respx.post("https://example.org/", files={"some_file": ("filename.txt", ANY)})

Fixes #115

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (master@07ae887). Click here to learn what that means.

❗ Current head b66080b differs from pull request most recent head c1a38e8. Consider uploading reports for the commit c1a38e8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             master      #253   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?        21           
  Lines             ?      2845           
  Branches          ?       428           
==========================================
  Hits              ?      2845           
  Misses            ?         0           
  Partials          ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ziima
Copy link

ziima commented Mar 18, 2024

Works for me. Files content types are not checked, but that may be fixed later.

Base automatically changed from fix/form-data-with-files to master March 18, 2024 16:06
@lundberg lundberg merged commit 24ee4a9 into master Mar 18, 2024
8 checks passed
@lundberg lundberg deleted the feature/files-pattern branch March 18, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a files pattern?
2 participants