Skip to main content

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/

Download files

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

Source Distribution

flea-1.tar.gz (16.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for flea-1.tar.gz
Algorithm Hash digest
SHA256 5341634b28ee7d94cf2a9a86089835b97c282d01c0e2e689d85e636b16ca9311
MD5 0b9dd0846e6c783e9bb2650710ee1013
BLAKE2b-256 cfd621eafb9edfeb5b2935486f9beb07a7be19bea8b4f6c0167c78890c0bc9d0

See more details on using hashes here.

Release history Release notifications | RSS feed

9.1.1

2 files

9.1.0

2 files

9.0.1

2 files

9.0.0

2 files

8.0.4

2 files

8.0.3

1 file

8.0.2

1 file

8.0.1

1 file

8.0

1 file

7.5.0

1 file

7.4.8

1 file

7.4.7

1 file

7.4.6

1 file

7.4.5

1 file

7.4.4

1 file

7.4.3

1 file

7.4.2

1 file

7.4.1

1 file

7.4.0

1 file

7.3.7

1 file

7.3.6

1 file

7.3.5

1 file

7.3.4

1 file

7.3.3

1 file

7.3.2

1 file

7.3.1

1 file

7.3.0

1 file

7.2.0

1 file

7.1.1

1 file

7.1.0

1 file

7

1 file

6

1 file

5

1 file

4

1 file

3

1 file

2

1 file

This release

1 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page