Mockhttp
No description available
Install / Use
/learn @disqus/MockhttpREADME
mockhttp
Work in progress library to mock http requests and return predefined fixtures for their results.
Whats Done
- basic urllib support (only tested with urlopen, non SSL)
- basic httplib support (only with non SSL)
Usage
::
with mockhttp.patch('urllib', (
# no params is default
(('http://foo.bar.com',), 'path/to/file.json'),
(('http://foo.bar.com', 'GET'), 'path/to/file.json'),
(('http://foo.bar.com', 'GET', {'a': 'b'}), 'path/to/file.json'),
(('http://foo.bar.com', 'POST', {'a': 'b'}), 'path/to/file.json'),
(('http://foo.bar.com', 'POST', {'a': 'b'}), mockhttp.response(status=404, headers=())),
)):
r = urllib.urlopen('http://foo.bar.com', 'a=b')
print r.read()
TODO
- coverage :)
- https suport
- urllib2
Related Skills
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.4kCommit, push, and open a PR
