replaylib is a (very experimental) library that allows you to install replacement stubs for httplib methods which record interactions with remote servers, and then play them back. Because urllib depends on httplib functionality, replaylib will record and play back urllib interactions as well.
It is intended to allow streamlined tests for services which interact with remote services: e.g. payment processors, shipping APIs, etc. To use it, just:
1. Run your test suite while recording with replaylib.
2. On subsequent runs, play back from replaylib. Tests will run faster, and won't require external services.
It is fully tested, with 100% line and branch coverage, and works well with all APIs we have tried it on "in the wild".
Note Use at your own risk!
Or if you prefer, download the source and then:
python setup.py build
python setup.py install
>>> import replaylib
>>> import urllib
# Do some stuff with urllib.
# Won't actually make a request to google.com
ReplayLib also comes with a nose plugin to make recording and playing back the interactions used by your test suites even simpler: