-------------------------------------------------------
|travis| |pypi| |docs|
Use Cases:
- Making assertions about api responses more readable
- Extending expectly with new assertions to reduce boilerplate
.. DANGER::
This library is in alpha. I will try my utmost to not make backwards incompatible changes
but it is possible that
Installing
==========
.. code-block:: shell
$ pip install expectly
API Examples
============
Built In Assertion methods
**************************
.. code-block:: python
# status_code (with status code number)
expect(response).to.have.status_code(200)
# header (asserts the header exists). Sets the header value to be further tested against
expect(response).to.have.header('Content-Type')
# equals
expect(response).to.have.header('Content-Type').equal('application/json')
# like (does a regex match against the value)
expect(response).to.have.header('Content-Type').like('application')
# exactly_like (does a regex match against the whole value
expect(response).to.have.header('Content-Type').exactly_like('^application/[\w]*$')
# encoding
expect(response).to.have.encoding('utf-8')
# ok (uses requests.response.ok attribute)
expect(response).to.be.ok
Extending expectly.expect with additional assertions
****************************************************
TODO
JSON handling in expectly
*************************
jsonschema is used for evaluating whether json responses match the relevant schema
jmespath is used for navigating/selecting information to test inside of the json response
Development
===========
.. code-block:: shell
$ git clone https://github.com/huntcsg/expectly.git
$ cd expectly
$ ./utils/manage clean
$ ./utils/manage test
$ ./utils/manage docs
1. All pull requests must pass the travis-ci builds
2. All pull requests should include inline (docstring) documentation, updates to built documentation if applicable,
and test coverage. This project aspires to be a 100% test coverage library.
.. |travis| image:: https://travis-ci.org/huntcsg/expectly.svg?branch=master
:target: https://travis-ci.org/huntcsg/expectly
.. |pypi| image:: https://img.shields.io/pypi/v/expectly.svg
:target: https://pypi.python.org/pypi/expectly
.. |docs| image:: https://readthedocs.org/projects/expectly/badge/?version=latest
:target: http://expectly.readthedocs.io/en/latest/?badge=latest
Changes
=======
0.1.0
*****
- Initial Release
Authors
-------
Hunter Senft-Grupp
Metadata
Release files for expectly 0.1.8
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 | |
|---|---|---|---|---|
| expectly-0.1.8.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| expectly-0.1.8-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 15.1 kB
Release files / expectly-0.1.8.tar.gz
| Download URL | expectly-0.1.8.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
700a3fea2cc566ccdf95b016c90a228fc0f133ed7544396c2e8ff38c612b7842
|
|
BLAKE2b-256 checksum How to use checksums |
42683711e82ff846a53297e86549221eccb01d6754817fc380eeff44540e9ca9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / expectly-0.1.8-py2.py3-none-any.whl
| Download URL | expectly-0.1.8-py2.py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
99b9514279fd006b4f9154dba19477b68d581fbec063f0d18d937805843b8d62
|
|
BLAKE2b-256 checksum How to use checksums |
84f4609cb53628b02a01d5fe07706e6d36bc20ddf2a50aa96e0bf5f47d08f3b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for expectly 0.1.8
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.