Skip to main content

Make live website tests look like Paste WebTest

Project description

Inspired by Ian Bicking’s excellent [WebTest module](, 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.

Note: File uploads are untested.


Setup an app to test against with just a hostname:

>>> import livetest
>>> app = livetest.TestApp('')

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'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for livetest, version 0.3dev
Filename, size File type Python version Upload date Hashes
Filename, size livetest-0.3dev.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page