Skip to content

Commit

Permalink
Добавил .rst доку, значение по умолчанию
Browse files Browse the repository at this point in the history
  • Loading branch information
bshelkhonov committed Sep 24, 2024
1 parent 7c4165c commit 25ae6d6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/source/yandex_music.artist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ Submodules
yandex_music.artist.description
yandex_music.artist.link
yandex_music.artist.ratings
yandex_music.artist.stats
yandex_music.artist.vinyl
7 changes: 7 additions & 0 deletions docs/source/yandex_music.artist.stats.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
yandex\_music.artist.stats
==========================

.. automodule:: yandex_music.artist.stats
:members:
:undoc-members:
:show-inheritance:
9 changes: 7 additions & 2 deletions tests/test_brief_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class TestBriefInfo:
concerts = None
has_promotions = False

def test_expected_values(self, brief_info, artist, track, album, playlist, cover, playlist_id, video, chart, vinyl):
def test_expected_values(
self, brief_info, artist, track, album, playlist, cover, playlist_id, video, chart, vinyl, stats
):
assert brief_info.artist == artist
assert brief_info.albums == [album]
assert brief_info.playlists == [playlist]
Expand All @@ -45,6 +47,7 @@ def test_expected_values(self, brief_info, artist, track, album, playlist, cover
assert brief_info.vinyls == [vinyl]
assert brief_info.has_promotions == self.has_promotions
assert brief_info.playlist_ids == [playlist_id]
assert brief_info.stats == stats
assert brief_info.tracks_in_chart == [chart]

def test_de_json_none(self, client):
Expand Down Expand Up @@ -84,7 +87,7 @@ def test_de_json_required(self, client, artist, track, album, playlist, cover, p
assert brief_info.has_promotions == self.has_promotions
assert brief_info.playlist_ids == [playlist_id]

def test_de_json_all(self, client, artist, track, album, playlist, cover, playlist_id, video, chart, vinyl):
def test_de_json_all(self, client, artist, track, album, playlist, cover, playlist_id, video, chart, vinyl, stats):
json_dict = {
'artist': artist.to_dict(),
'albums': [album.to_dict()],
Expand All @@ -101,6 +104,7 @@ def test_de_json_all(self, client, artist, track, album, playlist, cover, playli
'playlist_ids': [playlist_id.to_dict()],
'tracks_in_chart': [chart.to_dict()],
'playlists': [playlist.to_dict()],
'stats': stats.to_dict(),
}
brief_info = BriefInfo.de_json(json_dict, client)

Expand All @@ -118,6 +122,7 @@ def test_de_json_all(self, client, artist, track, album, playlist, cover, playli
assert brief_info.vinyls == [vinyl]
assert brief_info.has_promotions == self.has_promotions
assert brief_info.playlist_ids == [playlist_id]
assert brief_info.stats == stats
assert brief_info.tracks_in_chart == [chart]

def test_equality(self, artist, track, album, playlist, cover, playlist_id, video, vinyl, stats):
Expand Down
2 changes: 1 addition & 1 deletion yandex_music/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
'Experiments',
'Cover',
'Ratings',
'Stats',
'Counts',
'Link',
'Artist',
Expand Down Expand Up @@ -275,5 +276,4 @@
'CustomWave',
'R128',
'LyricsInfo',
'Stats',
]
2 changes: 1 addition & 1 deletion yandex_music/artist/brief_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BriefInfo(YandexMusicModel):
vinyls: List['Vinyl']
has_promotions: bool
playlist_ids: List['PlaylistId']
stats: Optional['Stats']
stats: Optional['Stats'] = None
tracks_in_chart: List['Chart'] = field(default_factory=list)
client: Optional['ClientType'] = None

Expand Down

0 comments on commit 25ae6d6

Please sign in to comment.