Skip to content

Commit 5efb8be

Browse files
nanotaboadaclaude
andcommitted
fix(api): add return types to modified routes, assert 201 in Location test
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9aa5105 commit 5efb8be

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

routes/player_route.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def post_async(
5050
player_model: Annotated[PlayerRequestModel, Body(...)],
5151
async_session: Annotated[AsyncSession, Depends(generate_async_session)],
5252
response: Response,
53-
):
53+
) -> PlayerResponseModel:
5454
"""
5555
Endpoint to create a new player.
5656
@@ -97,7 +97,7 @@ async def post_async(
9797
async def get_all_async(
9898
response: Response,
9999
async_session: Annotated[AsyncSession, Depends(generate_async_session)],
100-
):
100+
) -> List[PlayerResponseModel]:
101101
"""
102102
Endpoint to retrieve all players.
103103

tests/test_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def test_request_post_player_body_nonexistent_response_header_location(client):
297297
# Act
298298
response = client.post(PATH, json=player.__dict__)
299299
# Assert
300+
assert response.status_code == 201
300301
assert "Location" in response.headers
301302
assert (
302303
response.headers["Location"]

0 commit comments

Comments
 (0)