-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлены новые модели: CustomWave, R128, LyricsInfo. Классу Track добавлены новые поля: track_source, available_for_options, r128, lyrics_info, track_sharing_flag. Классу TrackShort добавлены новые поля: original_index. Классу Playlist добавлены новые поля: custom_wave, pager. Классу Album добавлены новые поля: available_for_options. --------- Co-authored-by: Ilya (Marshal) <[email protected]>
- Loading branch information
Showing
22 changed files
with
404 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
yandex\_music.playlist.custom\_wave | ||
=================================== | ||
|
||
.. automodule:: yandex_music.playlist.custom_wave | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
yandex\_music.track.lyrics\_info | ||
================================ | ||
|
||
.. automodule:: yandex_music.track.lyrics_info | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
yandex\_music.track.r128 | ||
======================== | ||
|
||
.. automodule:: yandex_music.track.r128 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import pytest | ||
|
||
from yandex_music import CustomWave | ||
|
||
|
||
class TestCustomWave: | ||
title = 'В стиле: Трибунал' | ||
animation_url = 'https://music-custom-wave-media.s3.yandex.net/base.json' | ||
position = 'default' | ||
|
||
def test_expected_values(self, custom_wave): | ||
assert custom_wave.title == self.title | ||
assert custom_wave.animation_url == self.animation_url | ||
assert custom_wave.position == self.position | ||
|
||
def test_de_json_none(self, client): | ||
assert CustomWave.de_json({}, client) is None | ||
|
||
def test_de_json_required(self, client): | ||
json_dict = { | ||
'title': self.title, | ||
'animation_url': self.animation_url, | ||
'position': self.position, | ||
} | ||
customwave = CustomWave.de_json(json_dict, client) | ||
|
||
assert customwave.title == self.title | ||
assert customwave.animation_url == self.animation_url | ||
assert customwave.position == self.position | ||
|
||
def test_de_json_all(self, client): | ||
json_dict = { | ||
'title': self.title, | ||
'animation_url': self.animation_url, | ||
'position': self.position, | ||
} | ||
customwave = CustomWave.de_json(json_dict, client) | ||
|
||
assert customwave.title == self.title | ||
assert customwave.animation_url == self.animation_url | ||
assert customwave.position == self.position | ||
|
||
def test_equality(self): | ||
a = CustomWave(self.title, self.animation_url, self.position) | ||
b = CustomWave('', self.animation_url, self.position) | ||
c = CustomWave(self.title, self.animation_url, self.position) | ||
|
||
assert a != b | ||
assert hash(a) != hash(b) | ||
assert a is not b | ||
|
||
assert a == c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from yandex_music import LyricsInfo | ||
|
||
|
||
class TestLyricsInfo: | ||
has_available_sync_lyrics = False | ||
has_available_text_lyrics = True | ||
|
||
def test_expected_values(self, lyrics_info): | ||
assert lyrics_info.has_available_sync_lyrics == self.has_available_sync_lyrics | ||
assert lyrics_info.has_available_text_lyrics == self.has_available_text_lyrics | ||
|
||
def test_de_json_none(self, client): | ||
assert LyricsInfo.de_json({}, client) is None | ||
|
||
def test_de_json_required(self, client): | ||
json_dict = { | ||
'has_available_sync_lyrics': self.has_available_sync_lyrics, | ||
'has_available_text_lyrics': self.has_available_text_lyrics, | ||
} | ||
lyrics_info = LyricsInfo.de_json(json_dict, client) | ||
|
||
assert lyrics_info.has_available_sync_lyrics == self.has_available_sync_lyrics | ||
assert lyrics_info.has_available_text_lyrics == self.has_available_text_lyrics | ||
|
||
def test_equality(self): | ||
a = LyricsInfo(self.has_available_sync_lyrics, self.has_available_text_lyrics) | ||
b = LyricsInfo(True, self.has_available_text_lyrics) | ||
c = LyricsInfo(self.has_available_sync_lyrics, self.has_available_text_lyrics) | ||
|
||
assert a != b | ||
assert hash(a) != hash(b) | ||
assert a is not b | ||
|
||
assert a == c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
from yandex_music import R128 | ||
|
||
|
||
class TestR128: | ||
i = -13.12 | ||
tp = 0.63 | ||
|
||
def test_expected_values(self, r_128): | ||
assert r_128.i == self.i | ||
assert r_128.tp == self.tp | ||
|
||
def test_de_json_none(self, client): | ||
assert R128.de_json({}, client) is None | ||
|
||
def test_de_json_required(self, client): | ||
json_dict = {'i': self.i, 'tp': self.tp} | ||
r128 = R128.de_json(json_dict, client) | ||
|
||
assert r128.i == self.i | ||
assert r128.tp == self.tp | ||
|
||
def test_equality(self): | ||
a = R128(self.i, self.tp) | ||
b = R128(-8.98, self.tp) | ||
c = R128(self.i, self.tp) | ||
|
||
assert a != b | ||
assert hash(a) != hash(b) | ||
assert a is not b | ||
|
||
assert a == c |
Oops, something went wrong.