I really like the way fakeweb in Ruby can be used to fake http requests when testing. Is there a similar library or an alternative for Python?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See also How can one mock/stub python module like urllib . The answer that recommends Mox seems the most like fakeweb, but Mox lets you create fake versions of any module, not just urllib.
For incoming requests, if your web framework uses WebOb (repoze.bfg, Pylons others), you can use
webob.Request.blank.