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
|
|
|
|
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
|
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):
|
2019-12-27 05:27:58 +09:00
|
|
|
json_dict = {'type_': self.type, 'uri': self.uri, 'items_uri': self.items_uri, 'dir_': self.dir,
|
2020-04-17 06:00:16 +09:00
|
|
|
'version': self.version, 'custom': self.custom, 'is_custom': self.is_custom, 'prefix': self.prefix,
|
|
|
|
'error': self.error}
|
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
|
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
|