Tornado Expects
Tornado-Expects is a matchers library for the Expects assertion library. It provides matchers for the Tornado web framework request and response objects.
Installation
You can install the last stable release from PyPI using pip or easy_install.
$ pip install tornado-expects
Also you can install the latest sources from Github.
$ pip install -e git+git://github.com/jaimegildesagredo/tornado-expects.git#egg=tornado-expects
Usage
Just import the expect callable and the Tornado-Expects matchers and start writing assertions for test doubles.
from expects import expect
from tornado_expects import *
from tornado.httpclient import HTTPClient
response = http_client.fetch('https://example.com')
expect(response).to(be_ok)
Matchers
be_ok
expect(response).to(be_ok)
expect(response).not_to(be_ok)
be_json
expect(response).to(be_json)
expect(response).not_to(be_json)
have_header
expect(response).to(have_header('Content-Type'))
expect(response).to(have_header('Content-Type', 'text/xml'))
expect(response).to(have_header('Content-Type', start_with('text/xml')))
expect(response).not_to(have_header('ETag'))
have_headers
expect(response).to(have_headers('Content-Type', 'Content-Length'))
expect(response).to(have_headers({'Content-Type': 'text/html'}))
expect(response).not_to(have_headers('Etag', 'Authorization'))
have_status
expect(response).to(have_status(304))
expect(response).not_to(have_status(500))
Specs
To run the specs you should install the testing requirements and then run mamba.
$ python setup.py develop
$ pip install -r test-requirements.txt
$ mamba
License
The Tornado-Expects is released under the Apache2 license.
Metadata
Release files for tornado-expects 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tornado-expects-0.1.0.tar.gz | 3.2 kB | Without provenance | Details for tornado-expects-0.1.0.tar.gz |
Release files / tornado-expects-0.1.0.tar.gz
| Download URL | tornado-expects-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1763951bcffa8614b4413b0489759d9215cb294b7fbdaef6e084a50979b4e36
|
|
BLAKE2b-256 checksum How to use checksums |
979d0ac1ca6457ee94cd99e51abce832abf91584644f4ef3e51f86446eab7494
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tornado-expects 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.