patrys / httmock

A mocking library for requests
Other
468 stars 57 forks source link

Provide mock with a Request, not PreparedRequest #16

Closed simon-weber closed 10 years ago

simon-weber commented 10 years ago

Providing a Request instead of a PreparedRequest would make complicated mocking much easier: Request basically holds the kwargs to requests.method, while PreparedRequest only stores encoded versions of the kwargs.

For example, if you'd like to replay request params (maybe when testing an OAuth flow), PreparedRequest requires reparsing request.path_url, while Request would provide request.params directly.

patrys commented 10 years ago

Would you like to provide a patch for that?

simon-weber commented 10 years ago

If you don't want to, I'll get to it eventually =)

dummerbd commented 10 years ago

Fixed: #30

simon-weber commented 10 years ago

:heart: