Zerotest makes it easy to test API server, start a micro proxy, send requests, and generate test code by these behaviours.
Install
Stable version: pip install zerotest
Develop version: pip install git+https://github.com/jjyr/zerotest.git
zerotest require python2.7 or 3.3+
Quick Start
Start a local proxy to capture http traffic zerotest server https://api.github.com -f octocat.data
Make few requests curl -i http://localhost:7000/users/octocat
Press C-c to exit local proxy
Generate test code zerotest generate octocat.data --ignore-all-headers > test_octocat.py
Type py.test test_octocat.py to run test
Usage
Type zerotest -h to see help message
Server
Start local proxy server
zerotest server http://target-endpoint.com [-f] [record_file.data]
Type zerotest server -h to see help message
Generate
Generate python test code from record data (the file generated by local proxy)
zerotest generate [options] > test_file.py
Ignore specific headers in comparison
Use option --ignore-headers [date server ...] or --ignore-all-headers to ignore headers comparison
Ignore specific fields
Use --fuzzy-match enable fuzzy matching mode, compare data schema instead the data itself, or you can use --ignore-fields [view_count ...] to specific ignored fields
Type zerotest generate -h to see help message
Replay
Generate test and run it with pytest
zerotest replay [generate options] [--pytest] [pytest options]
Type zerotest replay -h to see help message
Develop
Export debug flag ZEROTEST_DEBUG=true to see verbose logs during program or test running.
Contributors
Contribute
Open issue if found bugs or some cool ideas
Feel free to ask if have any questions
Testing is very important for a test tool, commit your test file together with pull request
Release files for zerotest 1.2.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 | |
|---|---|---|---|
| zerotest-1.2.1.tar.gz | 17.5 kB | Details |
Release files / zerotest-1.2.1.tar.gz
| Download URL | zerotest-1.2.1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1410eff814fa07d050460d319b1fe4b1eb050f98c0b46dcedb54e141fd0f6b08
|
|
BLAKE2b-256 checksum How to use checksums |
eb23751926d23891eb0c08cfd1936c8809764553c064128c8387fd665845dad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |