2019-11-08 02:09:39 +09:00
|
|
|
|
from yandex_music import Cover
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestCover:
|
Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
|
type = 'pic'
|
|
|
|
|
uri = 'avatars.yandex.net/get-music-user-playlist/38125/q0ahkhfQE3neTk/%%?1572609906461'
|
2019-11-08 02:09:39 +09:00
|
|
|
|
items_uri = None
|
Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
|
dir = '/get-music-user-playlist/34120/pvg900XixWaHcr/'
|
|
|
|
|
version = '1572609906461'
|
|
|
|
|
custom = True
|
2020-04-17 06:00:16 +09:00
|
|
|
|
is_custom = True
|
2019-11-08 02:09:39 +09:00
|
|
|
|
prefix = None
|
2020-06-06 23:06:23 +09:00
|
|
|
|
copyright_name = 'ТАСС'
|
|
|
|
|
copyright_cline = 'imago stock&people'
|
2019-11-08 02:09:39 +09:00
|
|
|
|
error = None
|
|
|
|
|
|
|
|
|
|
def test_expected_values(self, cover):
|
|
|
|
|
assert cover.type == self.type
|
|
|
|
|
assert cover.uri == self.uri
|
|
|
|
|
assert cover.items_uri == self.items_uri
|
|
|
|
|
assert cover.dir == self.dir
|
|
|
|
|
assert cover.version == self.version
|
|
|
|
|
assert cover.custom == self.custom
|
2020-04-17 06:00:16 +09:00
|
|
|
|
assert cover.is_custom == self.is_custom
|
2020-06-06 23:06:23 +09:00
|
|
|
|
assert cover.copyright_name == self.copyright_name
|
|
|
|
|
assert cover.copyright_cline == self.copyright_cline
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert cover.prefix == self.prefix
|
|
|
|
|
assert cover.error == self.error
|
|
|
|
|
|
2019-12-29 16:38:24 +09:00
|
|
|
|
def test_de_json_none(self, client):
|
|
|
|
|
assert Cover.de_json({}, client) is None
|
|
|
|
|
|
2019-12-29 17:06:27 +09:00
|
|
|
|
def test_de_list_none(self, client):
|
|
|
|
|
assert Cover.de_list({}, client) == []
|
|
|
|
|
|
2019-11-08 02:09:39 +09:00
|
|
|
|
def test_de_json_required(self, client):
|
|
|
|
|
json_dict = {}
|
|
|
|
|
cover = Cover.de_json(json_dict, client)
|
|
|
|
|
|
|
|
|
|
def test_de_json_all(self, client):
|
2021-02-03 21:28:10 +09:00
|
|
|
|
json_dict = {
|
2021-09-19 22:47:19 +09:00
|
|
|
|
'type': self.type,
|
2021-02-03 21:28:10 +09:00
|
|
|
|
'uri': self.uri,
|
|
|
|
|
'items_uri': self.items_uri,
|
2021-09-19 22:47:19 +09:00
|
|
|
|
'dir': self.dir,
|
2021-02-03 21:28:10 +09:00
|
|
|
|
'version': self.version,
|
|
|
|
|
'custom': self.custom,
|
|
|
|
|
'is_custom': self.is_custom,
|
|
|
|
|
'prefix': self.prefix,
|
|
|
|
|
'error': self.error,
|
|
|
|
|
'copyright_name': self.copyright_name,
|
|
|
|
|
'copyright_cline': self.copyright_cline,
|
|
|
|
|
}
|
2019-11-08 02:09:39 +09:00
|
|
|
|
cover = Cover.de_json(json_dict, client)
|
|
|
|
|
|
|
|
|
|
assert cover.type == self.type
|
|
|
|
|
assert cover.uri == self.uri
|
|
|
|
|
assert cover.items_uri == self.items_uri
|
|
|
|
|
assert cover.dir == self.dir
|
|
|
|
|
assert cover.version == self.version
|
|
|
|
|
assert cover.custom == self.custom
|
2020-04-17 06:00:16 +09:00
|
|
|
|
assert cover.is_custom == self.is_custom
|
2020-06-06 23:06:23 +09:00
|
|
|
|
assert cover.copyright_name == self.copyright_name
|
|
|
|
|
assert cover.copyright_cline == self.copyright_cline
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert cover.prefix == self.prefix
|
|
|
|
|
assert cover.error == self.error
|
|
|
|
|
|
Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
|
def test_equality(self, images):
|
|
|
|
|
a = Cover(self.type, self.uri, self.items_uri)
|
|
|
|
|
|
|
|
|
|
assert a != images
|
|
|
|
|
assert hash(a) != hash(images)
|
|
|
|
|
assert a is not images
|