A toolchain for testing REST APIs in BDD manner.
Project description
# bddrest
Toolchain to define and verify REST API in BDD.
## Quick start
```python
from bddrest import given, when, then, and_, response
with given(
wsgi_application,
title='Quickstart!',
url='/books/id: 1',
as_='visitor'):
then(response.status == '200 OK')
and_('foo' in response.json)
and_(response.json['foo'] == 'bar')
when(
'Trying invalid book id',
url_parameters={'id': None}
)
then(response.status_code == 404)
```
Toolchain to define and verify REST API in BDD.
## Quick start
```python
from bddrest import given, when, then, and_, response
with given(
wsgi_application,
title='Quickstart!',
url='/books/id: 1',
as_='visitor'):
then(response.status == '200 OK')
and_('foo' in response.json)
and_(response.json['foo'] == 'bar')
when(
'Trying invalid book id',
url_parameters={'id': None}
)
then(response.status_code == 404)
```
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
bddrest-0.3.1a1.dev4.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for bddrest-0.3.1a1.dev4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2901db30f350fd186411260fbce081fe118d5618dcfe9cab5e7e7a53bb0dc57f |
|
MD5 | 4aa3d72721fbef6ed74856bb92a86e51 |
|
BLAKE2b-256 | 62597d34bfa7000451450ae61cc00e68d00f95b32e402096b867fd8d76f41e9a |