Skip to content

Commit 8c4b284

Browse files
nanotaboadaclaude
andcommitted
fix(data): address PR review findings (#543)
- CHANGELOG: add Docker volume note to dataset normalization entry - test: wrap PUT act/assert in try/finally so teardown runs on failure; replace hardcoded Martínez JSON with existing_player() stub Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b99ef30 commit 8c4b284

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ This project uses famous football coaches as release codenames, following an A-Z
5555
add Almada (squad 16) as seeded substitute, correct
5656
Martínez/Fernández/Mac Allister/Messi field values, replace
5757
pre-computed UUIDs with canonical UUID v5 values (namespace
58-
`FIFA_WORLD_CUP_QATAR_2022_ARGENTINA_SQUAD`) (#543)
58+
`FIFA_WORLD_CUP_QATAR_2022_ARGENTINA_SQUAD`); bundled
59+
`storage/players-sqlite3.db` rebuilt from seed scripts — Docker
60+
deployments with a persisted volume will continue to use the old
61+
database until the volume is recreated (`docker compose down -v &&
62+
docker compose up --build`) (#543)
5963
- Align CRUD test fixtures: Lo Celso (squad 27) for Create and Delete,
6064
Messi (squad 10) for Retrieve, Damián Martínez (squad 23) for Update
6165
(#543)

tests/test_main.py

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -226,28 +226,17 @@ def test_request_put_player_squadnumber_existing_response_status_no_content(clie
226226
player = existing_player()
227227
player.first_name = "Emiliano"
228228
player.middle_name = None
229-
# Act
230-
response = client.put(
231-
PATH + "squadnumber/" + str(squad_number), json=player.__dict__
232-
)
233-
# Assert
234-
assert response.status_code == 204
235-
# Teardown — restore Damián Martínez to its seeded state
236-
client.put(
237-
PATH + "squadnumber/23",
238-
json={
239-
"firstName": "Damián",
240-
"middleName": "Emiliano",
241-
"lastName": "Martínez",
242-
"dateOfBirth": "1992-09-02T00:00:00.000Z",
243-
"squadNumber": 23,
244-
"position": "Goalkeeper",
245-
"abbrPosition": "GK",
246-
"team": "Aston Villa FC",
247-
"league": "Premier League",
248-
"starting11": True,
249-
},
250-
)
229+
try:
230+
# Act
231+
response = client.put(
232+
PATH + "squadnumber/" + str(squad_number), json=player.__dict__
233+
)
234+
# Assert
235+
assert response.status_code == 204
236+
finally:
237+
# Teardown — restore Damián Martínez to its seeded state
238+
seed = existing_player()
239+
client.put(PATH + "squadnumber/" + str(seed.squad_number), json=seed.__dict__)
251240

252241

253242
def test_request_put_player_squadnumber_mismatch_response_status_bad_request(client):

0 commit comments

Comments
 (0)