-
Notifications
You must be signed in to change notification settings - Fork 0
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 ParsedRequest assertions helper #12
Merged
Merged
Conversation
This file contains 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
Practice a wee bit of [RDD](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html)
This begins the development cycle of 1.2.0(-dev) by practicing a wee bit of RDD. 😉 |
DevL
commented
Mar 1, 2024
We only need to use the ParsedRequest constructor.
Once implemented, we may want to consider always passing a |
This is incomplete as there are more things to parse and expose as well as other cases to handle, e.g. errors when attempting to decode JSON.
Closed
DevL
changed the title
Add ParsedRequest and parse_request assertions helpers
Add ParsedRequest assertions helper
Mar 1, 2024
DevL
force-pushed
the
add-assertion-helpers-for-prepared-requests
branch
from
March 1, 2024 14:32
742f9f3
to
aa20c03
Compare
Co-authored-by: Lennart Fridén <[email protected]>
seb-lennuf
approved these changes
Mar 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This PR adds a
ParsedRequest
class that can be used in any existing assertions function to parse thePreparedRequest
in order to access convenience functions and properties such as parsing the URL into endpoint and query portions or parsing the body bytes into text or as JSON.It was considered to make
ParsedRequest
a subclass ofPreparedRequest
and then pass it directly to all assertions functions, but this could prove brittle ifrequests
would change thePreparedRequest
object. Still a possibility though. Another idea is to start providing theParsedRequest
object directly to assertions functions (without making it into a subclass), but this would be a breaking change and thus a candidate for a 2.0 release.Closes #4
Closes #13