Skip to content

Commit c53b006

Browse files
author
Martin Zihlmann
committed
add instructive test for this case
1 parent 085b374 commit c53b006

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_ext_flask.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,32 @@ def get_pet(pet_id):
180180

181181
spec.path(view=get_pet, app=app)
182182
assert "/pet/{pet_id}" in get_paths(spec)
183+
184+
def test_multiple_paths(self, app, spec):
185+
@app.put("/user")
186+
@app.route("/user/<user>")
187+
def user(user = None):
188+
"""A greeting endpoint.
189+
190+
---
191+
get:
192+
description: get user details
193+
responses:
194+
200:
195+
description: a user to be returned
196+
put:
197+
description: create a user
198+
responses:
199+
200:
200+
description: some data
201+
"""
202+
pass
203+
204+
for rule in app.url_map.iter_rules():
205+
spec.path(rule=rule)
206+
207+
paths = get_paths(spec)
208+
get_op = paths["/user/{user}"]["get"]
209+
put_op = paths["/user"]["put"]
210+
assert get_op["description"] == "get user details"
211+
assert put_op["description"] == "create a user"

0 commit comments

Comments
 (0)