mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-14 16:29:12 +00:00
add tests
This commit is contained in:
+2
-5
@@ -29,14 +29,11 @@ class UeController(ControllerBase):
|
||||
response=UeSchema,
|
||||
)
|
||||
def fetch_from_utbm_api(
|
||||
self,
|
||||
code: str,
|
||||
lang: Query[str] = "fr",
|
||||
year: Query[Annotated[int, Ge(2010)] | None] = None,
|
||||
self, code: str, year: Query[Annotated[int, Ge(2010)] | None] = None
|
||||
):
|
||||
"""Fetch UE data from the UTBM API and returns it after some parsing."""
|
||||
with UtbmApiClient() as client:
|
||||
res = client.find_ue(lang, code, year)
|
||||
res = client.find_ue(code, year)
|
||||
if res is None:
|
||||
raise NotFound
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user