Skip to content

Commit

Permalink
feat: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceAesth committed Nov 16, 2024
1 parent 02c5db9 commit 6198dde
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aiosu/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ async def get_score_replay_lazer(
:return: Replay file
:rtype: io.BytesIO
"""
url = f"{self.base_url}/api/v2/scores/{mode}/{score_id}/download"
url = f"{self.base_url}/api/v2/scores/{score_id}/download"
return await self._request("GET", url)

@prepare_token
Expand Down
Binary file added tests/data/v2/get_score_replay_lazer_200.osr
Binary file not shown.
1 change: 1 addition & 0 deletions tests/data/v2/get_score_replay_lazer_404.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"error":"Specified Score\\Best\\Osu couldn't be found."}
11 changes: 11 additions & 0 deletions tests/generate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,17 @@ def _register_routes(self) -> None:
f"{DATA_DIR}/v2/get_score_replay_404.json",
expect_status=404,
)
self._register_route(
"GET",
f"{BASE_URL}/api/v2/scores/1581778626/download",
f"{DATA_DIR}/v2/get_score_replay_lazer_200.osr",
)
self._register_route(
"GET",
f"{BASE_URL}/api/v2/scores/0/download",
f"{DATA_DIR}/v2/get_score_replay_lazer_404.json",
expect_status=404,
)
self._register_route(
"GET",
f"{BASE_URL}/api/v2/rankings/osu/performance",
Expand Down
7 changes: 6 additions & 1 deletion tests/test_v2/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ async def test_generated(status_code, content_type, token, mocker):
generate_test(
aiosu.v2.Client.get_score_replay,
STATUS_CAN_404_OCTET,
func_kwargs={"score_id": 4220635589, "mode": "osu"},
func_kwargs={"legacy_score_id": 4220635589, "mode": "osu"},
),
generate_test(
aiosu.v2.Client.get_score_replay_lazer,
STATUS_CAN_404_OCTET,
func_kwargs={"score_id": 1581778626},
),
generate_test(
aiosu.v2.Client.get_rankings,
Expand Down

0 comments on commit 6198dde

Please sign in to comment.