Skip to content

Commit 1c6a019

Browse files
committed
Improved coverage
1 parent 946ae5e commit 1c6a019

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_server_view.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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

151161
def 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]

0 commit comments

Comments
 (0)