File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Features
24
24
- Launch the local gateway per test function
25
25
- Provide an abstracted client fixture to access the local gateway
26
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
27
+ - As of Chalice version 1.8.0, LocalGateway object doesn't handle Cognito's context
28
28
- Not only for this purpose, it's an interface provided to allow custom contexts in unit tests
29
29
30
30
@@ -46,9 +46,28 @@ You can install "pytest-chalice" via `pip`_ from `PyPI`_::
46
46
Usage
47
47
-----
48
48
49
- .. literalinclude :: examples/simple/app.py
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' }
50
70
51
- .. literalinclude :: examples/simple/tests/test_app.py
52
71
53
72
See `examples <https://github.com/studio3104/pytest-chalice/tree/master/examples >`_ for more detailed
54
73
You can’t perform that action at this time.
0 commit comments