Skip to content

Commit

Permalink
Fix broken API url for garages (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas authored Jan 19, 2023
1 parent 2d9becc commit b2432a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions odp_amsterdam/odp_amsterdam.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def all_garages(self) -> list[Garage]:
ODPAmsterdamError: If the data is not valid.
"""
results: list[Garage] = []
data = await self._request("dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ")
data = await self._request("dcatd/datasets/9ORkef6T-aU29g/purls/1")

for item in data["features"]:
try:
Expand All @@ -153,7 +153,7 @@ async def garage(self, garage_id: str) -> Garage:
Raises:
ODPAmsterdamResultsError: When no results are found.
"""
data = await self._request("dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ")
data = await self._request("dcatd/datasets/9ORkef6T-aU29g/purls/1")
try:
result = [item for item in data["features"] if item["Id"] in garage_id]
return Garage.from_json(result[0])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def test_all_garages(aresponses: ResponsesMockServer) -> None:
"""Test all garage function."""
aresponses.add(
"api.data.amsterdam.nl",
"/dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ",
"/dcatd/datasets/9ORkef6T-aU29g/purls/1",
"GET",
aresponses.Response(
status=200,
Expand All @@ -43,7 +43,7 @@ async def test_single_garage(aresponses: ResponsesMockServer) -> None:
"""Test a single garage model."""
aresponses.add(
"api.data.amsterdam.nl",
"/dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ",
"/dcatd/datasets/9ORkef6T-aU29g/purls/1",
"GET",
aresponses.Response(
status=200,
Expand Down Expand Up @@ -90,7 +90,7 @@ async def test_wrong_garage_model(aresponses: ResponsesMockServer) -> None:
"""Test a wrong garage model."""
aresponses.add(
"api.data.amsterdam.nl",
"/dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ",
"/dcatd/datasets/9ORkef6T-aU29g/purls/1",
"GET",
aresponses.Response(
status=200,
Expand All @@ -110,7 +110,7 @@ async def test_no_garage_found(aresponses: ResponsesMockServer) -> None:
"""Test a wrong garage model."""
aresponses.add(
"api.data.amsterdam.nl",
"/dcatd/datasets/9ORkef6T-aU29g/purls/l6HdY0TFamuFOQ",
"/dcatd/datasets/9ORkef6T-aU29g/purls/1",
"GET",
aresponses.Response(
status=200,
Expand Down

0 comments on commit b2432a9

Please sign in to comment.