From 6150f6fd04bf1aae9ee5680b8d3779717f4356ae Mon Sep 17 00:00:00 2001 From: Marshal Date: Mon, 13 Jan 2020 20:24:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D0=BF=D1=86=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BF=D0=BE=D0=BB=D0=B5=20version?= =?UTF-8?q?=20=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20Album.=20=D0=9E?= =?UTF-8?q?=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D1=8B=20#178?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/conftest.py | 6 +++--- tests/test_album.py | 5 ++++- yandex_music/album/album.py | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5111303..098f9f2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -81,9 +81,9 @@ def album_factory(label, track_position): class AlbumFactory: def get(self, artists, volumes): return Album(TestAlbum.id, TestAlbum.title, TestAlbum.track_count, artists, [label], - TestAlbum.available, TestAlbum.available_for_premium_users, TestAlbum.cover_uri, - TestAlbum.content_warning, TestAlbum.original_release_year, TestAlbum.genre, - TestAlbum.og_image, TestAlbum.buy, TestAlbum.recent, TestAlbum.very_important, + TestAlbum.available, TestAlbum.available_for_premium_users, TestAlbum.version, + TestAlbum.cover_uri, TestAlbum.content_warning, TestAlbum.original_release_year, + TestAlbum.genre, TestAlbum.og_image, TestAlbum.buy, TestAlbum.recent, TestAlbum.very_important, TestAlbum.available_for_mobile, TestAlbum.available_partially, TestAlbum.bests, TestAlbum.prerolls, volumes, TestAlbum.year, TestAlbum.release_date, TestAlbum.type, track_position, TestAlbum.regions) diff --git a/tests/test_album.py b/tests/test_album.py index 922d609..fb981dd 100644 --- a/tests/test_album.py +++ b/tests/test_album.py @@ -4,6 +4,7 @@ from yandex_music import Album class TestAlbum: id = 5239478 title = 'In the End' + version = 'feat. Mark Van Hoen & Mike Harding' cover_uri = 'avatars.yandex.net/get-music-content/95061/89c14a7d.a.5239478-1/%%' track_count = 3 available = True @@ -27,6 +28,7 @@ class TestAlbum: def test_expected_values(self, album, artist_without_tracks, label, track_position, track_without_albums): assert album.id == self.id assert album.title == self.title + assert album.version == self.version assert album.cover_uri == self.cover_uri assert album.track_count == self.track_count assert album.artists == [artist_without_tracks] @@ -75,7 +77,7 @@ class TestAlbum: def test_de_json_all(self, client, artist, label, track_position, track): json_dict = {'id_': self.id, 'title': self.title, 'cover_uri': self.cover_uri, 'track_count': self.track_count, 'artists': [artist.to_dict()], 'labels': [label.to_dict()], 'available': self.available, - 'available_for_premium_users': self.available_for_premium_users, + 'available_for_premium_users': self.available_for_premium_users, 'version': self.version, 'content_warning': self.content_warning, 'original_release_year': self.original_release_year, 'genre': self.genre, 'og_image': self.og_image, 'buy': self.buy, 'recent': self.recent, 'very_important': self.very_important, 'available_for_mobile': self.available_for_mobile, @@ -87,6 +89,7 @@ class TestAlbum: assert album.id == self.id assert album.title == self.title + assert album.version == self.version assert album.cover_uri == self.cover_uri assert album.track_count == self.track_count assert album.artists == [artist] diff --git a/yandex_music/album/album.py b/yandex_music/album/album.py index 7cfab2b..99cfd47 100644 --- a/yandex_music/album/album.py +++ b/yandex_music/album/album.py @@ -15,6 +15,7 @@ class Album(YandexMusicObject): labels: List['Label'], available: bool, available_for_premium_users: bool, + version: Optional[str] = None, cover_uri: Optional[str] = None, content_warning=None, original_release_year=None, @@ -43,6 +44,7 @@ class Album(YandexMusicObject): self.available_for_premium_users = available_for_premium_users self.available = available + self.version = version self.cover_uri = cover_uri self.genre = genre self.year = year