@@ -18,19 +18,21 @@ A set of py.test fixtures for AWS Chalice
1818
1919----
2020
21- This `pytest `_ plugin was generated with `Cookiecutter `_ along with `@hackebrot `_'s `cookiecutter-pytest-plugin `_ template.
22-
23-
2421Features
25- --------
22+ ------------
2623
27- * TODO
24+ - Launch the local gateway per test function
25+ - Provide an abstracted client fixture to access the local gateway
26+ - Expose an interface to overwrite response context with arbitrary objects
27+ - As of Chalice version 1.8.0, LocalGateway object doesn't handle Cognito's context
28+ - Not only for this purpose, it's an interface provided to allow custom contexts in unit tests
2829
2930
3031Requirements
3132------------
3233
33- * TODO
34+ - `pytest `_
35+ - `Chalice `_
3436
3537
3638Installation
@@ -44,7 +46,30 @@ You can install "pytest-chalice" via `pip`_ from `PyPI`_::
4446Usage
4547-----
4648
47- * TODO
49+ .. code-block :: python
50+
51+ from chalice import Chalice
52+
53+ app = Chalice(__name__ )
54+
55+
56+ @app.route (' /' )
57+ def index:
58+ return {' hello' : ' world' }
59+
60+
61+ .. code-block :: python
62+
63+ from http import HTTPStatus
64+
65+
66+ def test_index (client ):
67+ response = client.get(' /' )
68+ assert response.status_code == HTTPStatus.OK
69+ assert response.json == {' hello' : ' world' }
70+
71+
72+ See `examples <https://github.com/studio3104/pytest-chalice/tree/master/examples >`_ for more detailed
4873
4974Contributing
5075------------
6287
6388If you encounter any problems, please `file an issue `_ along with a detailed description.
6489
65- .. _`Cookiecutter` : https://github.com/audreyr/cookiecutter
6690.. _`@hackebrot` : https://github.com/hackebrot
6791.. _`MIT` : http://opensource.org/licenses/MIT
6892.. _`BSD-3` : http://opensource.org/licenses/BSD-3-Clause
@@ -74,3 +98,4 @@ If you encounter any problems, please `file an issue`_ along with a detailed des
7498.. _`tox` : https://tox.readthedocs.io/en/latest/
7599.. _`pip` : https://pypi.org/project/pip/
76100.. _`PyPI` : https://pypi.org/project
101+ .. _`Chalice` : https://github.com/aws/chalice
0 commit comments