Overview

Browser-like WSGI integration testing.

>>> from bailey import Browser
>>> from werkzeug import test_app
>>> browser = Browser(test_app)
>>> response = browser.get('/')
>>> response
<bailey.browser.BrowserResponse object at 0x12716d0>
>>> response.data[:62]
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"'
>>> response.headers
Headers([('Content-Type', 'text/html; charset=utf-8')])
>>> response.document
<Element html at 14879d0>
>>> [h2.text for h2 in response.document.cssselect('h2')]
['Python Interpreter', 'WSGI Environment', 'Installed Eggs']