17 lines
499 B
Python
17 lines
499 B
Python
from athlete import Athlete
|
|
def test_getAthlete(client):
|
|
response = client.get("/1")
|
|
# Check if can be mapped to Athlete RootModel object
|
|
|
|
athlete = Athlete(
|
|
id=1,
|
|
prenom="Teddy",
|
|
nom="Riner",
|
|
pays="France",
|
|
sexe="H",
|
|
image="https://upload.wikimedia.org/wikipedia/commons/4/4e/Teddy_Riner_2012.jpg",
|
|
disciplines=[1],
|
|
records=[],
|
|
)
|
|
assert athlete.model_dump() == response.json
|
|
assert response.status_code == 200
|