File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments