introduces a consistency check in the PUT /{username} route #14
introduces a consistency check in the PUT /{username} route #14IbraheemTuffaha merged 2 commits intoIbraheemTuffaha:mainfrom
Conversation
|
There was a problem hiding this comment.
Good catch!
I did not pay much attention to such cases as it was just a dummy user service & router.
I believe the check you created should be part of the UserManager that raises an error in the manager itself and gets caught in the router
But we already raise a ValueError for a different error code 404 so that's not possible now
I'll approve it and I guess if someone wants to clean it they cal
One option would be to create error classes specific for user issues instead of using generic ValueError and handle each one independently in the router with their respective error codes
What do you think @federicsp?
yes, absolutely! |



introduces a consistency check in the PUT /{username} route to ensure that the username in the path matches the one in the request body.
Some 4xx-related tests were reorganized and moved to test_users_4xx.py, and new test cases were added to improve coverage for invalid input scenarios.