File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,16 @@ def post(self):
147147 # Main test
148148 Index ().get_value ()
149149
150+ def test_get_responses (app_ctx ):
151+ class Index (view .View ):
152+ def post (self ):
153+ return {}
154+
155+ responses = Index .get_responses ()
156+ assert 200 in responses
157+ assert responses [200 ]["content_type" ] == "application/json"
158+ assert "schema" in responses [200 ]
159+
150160
151161def test_get_value_response_text (app_ctx ):
152162 class Index (view .View ):
@@ -170,3 +180,14 @@ def get(self):
170180 assert Index ().get ().headers .get ("Content-Type" ) == "application/json"
171181 # Main test
172182 assert Index ().get_value () == {"json" : "body" }
183+
184+
185+ def test_action_view_get_responses (app_ctx ):
186+ class Index (view .ActionView ):
187+ def post (self ):
188+ return {}
189+
190+ responses = Index .get_responses ()
191+ assert 201 in responses
192+ assert responses [201 ]["content_type" ] == "application/json"
193+ assert "schema" in responses [201 ]
You can’t perform that action at this time.
0 commit comments