You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would have expected to be able to access the query string and body of the original request via the mock object. This would allow more complex assertions in a more imperative way than the (pretty declarative) matcher approach (which is great for simple cases though).
Since a single mocked response can be called multiple times, maybe it'd be nice to have something like req.calls[...] = with request objects (similar to the requests.Request class) that contain the original data from the request that was intercepted by this library.
The text was updated successfully, but these errors were encountered:
I think this is conceptual mistake. rsps.add returns Response object and not request
although, you can use resp.request which will return you requests.models.PreparedRequest
Sure, but I do not have access to resp when I call a function from my application that makes an HTTP request I'm mocking.
So basically I'm looking for a way to access the resp.request through without having access to resp. A bit like stdlib Mock objects give you access to all calls made on its methods.
I would have expected to be able to access the query string and body of the original request via the mock object. This would allow more complex assertions in a more imperative way than the (pretty declarative) matcher approach (which is great for simple cases though).
Since a single mocked response can be called multiple times, maybe it'd be nice to have something like
req.calls[...] =
with request objects (similar to therequests.Request
class) that contain the original data from the request that was intercepted by this library.The text was updated successfully, but these errors were encountered: