Skip to main content

Functional testing for WSGI: drive WSGI apps from your test suite

Project description

Flea helps you write functional tests for WSGI applications.

Flea uses CSS selectors and XPath to give you a powerful tool to drive and test the output of your WSGI web applications. Here’s an example of how easy it is to test a WSGI application:

>>> from flea import Agent
>>> r = Agent(my_wsgi_app).get('/')
>>> print r.body
<html>
        <body>
                <a href="/sign-in">sign in</a>
        </body>
</html>
>>> r = r.click('sign in')
>>> r = r("form#login-form").fill(
...     username = 'root',
...     password = 'secret',
... ).submit()
>>> assert 'login successful' in r.body

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 flea, version 9.0.1
Filename, size File type Python version Upload date Hashes
Filename, size flea-9.0.1.tar.gz (30.1 kB) File type Source Python version None Upload date Hashes View
Filename, size flea-9.0.1-py3-none-any.whl (24.4 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page