Skip to main content

Test WSGI applications using lxml

Project description

Flea helps you test WSGI applications without starting up an HTTP server.

If you already know lxml, you’ll know what makes flea so powerful. Flea is fully integrated with lxml’s xpath api, letting you inspect, modify and navigate HTML documents returned from your WSGI application. Here’s an example session:

>>> agent = TestAgent(my_wsgi_app)
>>> agent.get('/')
>>> print agent.body
<html>
        <body>
                <a href="/sign-in">sign in</a>
        </body>
</html>
>>> agent = agent["//a[.='sign in']"].click()
>>> print agent.request.request_uri
http://localhost/sign-in
>>> agent["//input[@name='username']"].value = 'root'
>>> agent["//input[@name='password']"].value = 'password'
>>> agent = agent["//input[@type='submit']"].submit()

Full package documentation: http://packages.python.org/flea/

Project details


Download files

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

Source Distribution

flea-3.tar.gz (16.7 kB view details)

Uploaded Source

File details

Details for the file flea-3.tar.gz.

File metadata

  • Download URL: flea-3.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flea-3.tar.gz
Algorithm Hash digest
SHA256 3802e0d80b13a57a77616fce7a64384b7047a0bef5f156aed8206c823e744f84
MD5 6c9505523e1cfdbfb2eccfa08fb08bb4
BLAKE2b-256 ee8a9790a34e92f1fb23c59ae93e0920cea30229b34e1e61f8db7f4f8c81782e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page