Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove rate album methods #499

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/deezer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,6 @@ def get_album(self, album_id: int) -> Album:
"""
return self.request("GET", f"album/{album_id}")

def rate_album(self, album_id: int, note: int) -> bool:
"""
Rate the album of the given ID with the given note.

The note should be and integer between 1 and 5.

:returns: boolean whether rating was applied
"""
return self.request("POST", f"album/{album_id}", note=note)

def get_artist(self, artist_id: int) -> Artist:
"""
Get the artist with the given ID.
Expand Down
9 changes: 0 additions & 9 deletions src/deezer/resources/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,3 @@ def get_tracks(self, **kwargs) -> PaginatedList[Track]:
of :class:`Track <deezer.resources.Track>`.
"""
return self.get_paginated_list("tracks", **kwargs)

def rate(self, note: int) -> bool:
"""
Rate the album with the given note.

:param note: rating to give.
:return: boolean, whether the album was rated
"""
return self.client.rate_album(album_id=self.id, note=note)
54 changes: 0 additions & 54 deletions tests/cassettes/TestClient.test_rate_album.yaml

This file was deleted.

53 changes: 0 additions & 53 deletions tests/cassettes/TestClient.test_rate_album_error.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions tests/resources/cassettes/TestAlbum.test_rate.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions tests/resources/test_album.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,3 @@ def test_as_dict(self, client):
album_dict = album.as_dict()
assert album_dict["id"] == 302127
assert album_dict["release_date"] == "2001-03-07"

def test_rate(self, client_token):
album = deezer.Album(client_token, {"id": 302127})
result = album.rate(3)
assert result is True
8 changes: 0 additions & 8 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,3 @@ def test_with_language_header(self, header_value, expected_name):
def test_process_json_types(self, client, json, expected_type):
result = client._process_json(json)
assert type(result) == expected_type

def test_rate_album(self, client_token):
result = client_token.rate_album(302127, 4)
assert result is True

def test_rate_album_error(self, client):
with pytest.raises(DeezerErrorResponse):
client.rate_album(302127, 4)