feat(testing): simulate multipart file upload#2141
feat(testing): simulate multipart file upload#2141TigreModerata wants to merge 59 commits intofalconry:masterfrom
Conversation
Tests: added a test case to test_unset_cookies and to on_get in CookieUnset
…te; added towncrier news fragment.
…load (text, urlencoded, image, nested) and some errors.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2141 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 7485 7522 +37
Branches 1278 1286 +8
=========================================
+ Hits 7485 7522 +37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I used urllib3 and I added it to requirements, but it isn't found in the tests - where does it need to be added to be seen? |
|
Hi again @TigreModerata, and thanks for this improvement 👍 |
|
I'll try to write it out, it's probably good exercise :) |
|
Yeah, it should be easy at least when it comes to basic functionality, check out |
There was a problem hiding this comment.
Looks great so far 💯
As discussed, we just need to get rid of urllib3, or if the functionality in question is non-trivial to implement, we need to make it optional, like msgpack, jsonschema, etc.
(But of course I'd prefer if this was implemented directly in the framework.)
tests/files/loremipsum.txt
Outdated
| @@ -0,0 +1,11 @@ | |||
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor | |||
There was a problem hiding this comment.
Do we really need to add separate files? Maybe we could just use inline strings, or use existing source or image files?
Otherwise we need to surface these new files in MANIFEST.in to get them included in the sdist.
There was a problem hiding this comment.
I didn't really know... I wanted to make sure all goes well mainly with bigger stuff (the image), but now that I'm sure I'll remove them.
| - CPython 3.11 is now fully supported. (`#2072 <https://github.com/falconry/falcon/issues/2072>`__) | ||
| - End-of-life Python 3.5 & 3.6 are no longer supported. (`#2074 <https://github.com/falconry/falcon/pull/2074>`__) | ||
|
|
||
|
|
There was a problem hiding this comment.
Is there any particular reason behind this newline removal?
There was a problem hiding this comment.
I don't know what happened... was that me?
There was a problem hiding this comment.
I think it must have been you, yes. It is coming from you changeset, but it might be some artefact of merging things back and forth on your side, not necessarily something you actively did.
|
(I'm in the process of terraforming this somewhat... ) |
|
Hi @vytas7 , did something happen, can I do anything to help? I just got a notification saying "mentioned" but I'm not sure why. I've not looked at this in ages, but I have time and I'm happy to try to contribute. |
|
Hi @TigreModerata! I was thinking to update your PR, and to change Does that sound like a good plan? |
I'm not totally sure what needs to be done, I need to refresh my memory a bit. But yeah, I'm happy if I can contribute! |
|
Hi again @TigreModerata!
That's why I thought it would be a good opportunity to restart this from scratch, it doesn't need to be too complex in the first iteration. I was thinking we could simply add a I have written a simple proof-of-concept implementation, but it needs more validation, tests, documentation, and a newsfragment.
You are very welcome to! |
CaselIT
left a comment
There was a problem hiding this comment.
overall seems ok. I've not checked if the api is consistent with what was suggested before or what request etc do
Summary of Changes
Draft of tests section for post-ing files as multipart/form-data. Parameter 'files' added to simulate_requests in the testing client, as well as a file test_multipart_formdata_request of tests.
Related Issues
#1010
Pull Request Checklist
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!
If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.
docs/.docs/.versionadded,versionchanged, ordeprecateddirectives.docs/_newsfragments/, with the file name format{issue_number}.{fragment_type}.rst. (Runtowncrier --draftto ensure it renders correctly.)If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
PR template inspired by the attrs project.