replaylib - Make better tests when using remote HTTP services
- Authors:
Scott Torborg (storborg) Mike Spindel (deactivated)
- Version:
0.1
This (very experimental) library 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:
Run your test suite while recording with replaylib.
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!
Installation
Simple as:
$ easy_install replaylib
Or if you prefer, download the source and then:
$ python setup.py build $ python setup.py install
Example
>>> import replaylib >>> import urllib
>>> replaylib.start_record()
# Do some stuff with urllib.
>>> urllib.urlopen('http://www.google.com')
>>> replaylib.stop_record('activity.pkl')
>>> replaylib.start_playback('activity.pkl')
# Won't actually make a request to google.com
>>> urllib.urlopen('http://www.google.com')
>>> replaylib.stop_playback()
Nose Plugin
ReplayLib also comes with a nose plugin to make recording and playing back the interactions used by your test suites even simpler:
$ nosetests --replaylib-record=test.pkl $ nosetests --replaylib-playback=test.pkl
License
ReplayLib is released under the GNU General Public License (GPL). See the LICENSE file for full text of the license.
Metadata
Release files for replaylib 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| replaylib-0.1.tar.gz | 20.6 kB | Without provenance | Details for replaylib-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| replaylib-0.1-py2.6.egg | Legacy Egg format | - | - | Details for replaylib-0.1-py2.6.egg |
Total release size: 42.2 kB
Release files / replaylib-0.1.tar.gz
| Download URL | replaylib-0.1.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d77b29d993233287c8c7c35d41a059c461bd841b4f83a509e85922f7ea27b02a
|
|
BLAKE2b-256 checksum How to use checksums |
aaa4da3c4f1f8a8fe582b222da9c3374ac0667fda0f0b36dff0e6100c960976f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / replaylib-0.1-py2.6.egg
| Download URL | replaylib-0.1-py2.6.egg |
|---|---|
| Size | 21.6 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
0664b00a84a18af14fa00698209afe68d818c3a0571f84d79795204913981c4f
|
|
BLAKE2b-256 checksum How to use checksums |
db79b2899aec2781b5e847fc0a4b706c0f67ba21d735ec91405cd37ae34d41aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for replaylib 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.