Inspired by Ian Bicking’s excellent WebTest, this is an extension to allow the same sort of simple pythonic testing to be used against running sites. Many tests written for WebTest will be able to be used directly on LiveTest.
This enables the full platform (app servers, load balancers, routing, DNS, etc) to be tested rather than just the internal WSGI application.
Installation
Simple as:
$ easy_install livetest
Or with pip:
$ pip install livetest
Or grab the development version:
$ easy_install livetest==dev
Usage
Setup an app to test against with just a hostname:
>>> import livetest
>>> app = livetest.TestApp('www.google.com')
Make requests just like WebTest:
>>> resp = app.get('/')
Grab forms:
>>> resp.forms
{0: <webtest.Form object at 0x10118ac50>}
>>> form = resp.forms[0]
>>> form.fields
{'btnI': [<webtest.Submit object at 0x10118ae10>],
'btnG': [<webtest.Submit object at 0x10118add0>],
'q': [<webtest.Text object at 0x10118ad90>],
'source': [<webtest.Hidden object at 0x10118ad10>],
'hl': [<webtest.Hidden object at 0x10118acd0>],
'ie': [<webtest.Hidden object at 0x10118ad50>]}
Submit forms:
>>> form['q'] = 'python testing' >>> resp = form.submit()
Test stuff in the response:
>>> resp.mustcontain('Agile', 'unittest', 'PyUnit')
>>> resp
<200 OK text/html body='<!doctype...v> '/25498>
>>> resp.status
'200 OK'
Credits
Thanks to Edward Dale (scompt) for various fixes.
Links
License
Livetest is released under the MIT License. See the LICENSE file for more information.
Metadata
Release files for livetest 0.5
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 | |
|---|---|---|---|---|
| livetest-0.5.tar.gz | 7.8 kB | Without provenance | Details |
Release files / livetest-0.5.tar.gz
| Download URL | livetest-0.5.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f96a40c34845c9ff64e175be3b21f251cac10bfca9cd5b9252890509b7d74838
|
|
BLAKE2b-256 checksum How to use checksums |
de777ab378ff9e62013f1756b64b1553e126ba7b3f3598bc9c5c8fc508c13d55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for livetest 0.5
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.