Integration of Falcon API unit tests with Bravado.
Project description
Integration of Falcon API unit tests with Bravado. For testing your application’s contract.
You can easily implement Bravado integrations for other frameworks’ unit tests (e.g. Flask’s) based on this code.
This library doesn’t do much, but it’s actually feature-complete (there weren’t that many features to implement…).
One thing that can be changed in the future is the way Falcon requests are simulated. Right now it’s done with pytest-falcon, but you don’t have to use Pytest in your tests (but it’s great and you probably should at least check it out).
Usage
from bravado.client import SwaggerClient
from bravado_falcon import FalconHttpClient
api = get_falcon_api() # get a falcon.API
swagger_spec = get_swagger_spec() # dict created by loading a YAML or JSON from a file
client = SwaggerClient.from_spec(swagger_spec,
http_client=FalconHttpClient(api))
# "v1" is the first part of a path (e.g. "/v1/shopping/lists")
# "getList" is the "operationId" element for an endpoint from Swagger
# "id" is a path parameter (let's say from "/v1/shopping/lists/{id}")
# See Bravado docs for more information.
list_object = client.v1.getList(id='list-id').result()
# now make assertions about the returned object
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bravado-falcon-0.0.1.tar.gz.
File metadata
- Download URL: bravado-falcon-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278a67fdbe62c05d1889b187315c3297041a4b4ae1234ab84278ccfb009467b3
|
|
| MD5 |
851c11aefd8bcd665d21db8dac4007b9
|
|
| BLAKE2b-256 |
ceef7ec3cc9138cfed6cd05590b096893df1984eb485c34cd3601fdc2454b6d2
|
File details
Details for the file bravado_falcon-0.0.1-py3-none-any.whl.
File metadata
- Download URL: bravado_falcon-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278e3f7df86ba01bbb3d48f30a59da750455b1df0977a9e904b4105d06d1d012
|
|
| MD5 |
eb4560f7851ec501e48213350d13dbce
|
|
| BLAKE2b-256 |
f13dba13c86ee7492615fe2036ab5a1a2cb6d5b84eea58b9f2520bc56787310a
|
File details
Details for the file bravado_falcon-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: bravado_falcon-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aac7ab7d169f38e02ddaec0e85f2049973738cec5862334ea83576385bb76a6
|
|
| MD5 |
0f86b979742d351a48ae3643dbb0af92
|
|
| BLAKE2b-256 |
b7839ef9aad3e7da1a6c45a6bb577117aa4f9c6c5d1b2ca4933f04aedd4924b3
|