Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
from yandex_music import MadeFor
|
|
|
|
|
|
|
|
|
|
|
|
class TestMadeFor:
|
|
|
|
def test_expected_values(self, made_for, user, case_forms):
|
|
|
|
assert made_for.user_info == user
|
|
|
|
assert made_for.case_forms == case_forms
|
|
|
|
|
2019-12-29 16:38:24 +09:00
|
|
|
def test_de_json_none(self, client):
|
|
|
|
assert MadeFor.de_json({}, client) is 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
|
|
|
def test_de_json_required(self, client, user, case_forms):
|
|
|
|
json_dict = {'user_info': user.to_dict(), 'case_forms': case_forms.to_dict()}
|
|
|
|
made_for = MadeFor.de_json(json_dict, client)
|
|
|
|
|
|
|
|
assert made_for.user_info == user
|
|
|
|
assert made_for.case_forms == case_forms
|
|
|
|
|
|
|
|
def test_de_json_all(self, client, user, case_forms):
|
|
|
|
json_dict = {'user_info': user.to_dict(), 'case_forms': case_forms.to_dict()}
|
|
|
|
made_for = MadeFor.de_json(json_dict, client)
|
|
|
|
|
|
|
|
assert made_for.user_info == user
|
|
|
|
assert made_for.case_forms == case_forms
|
|
|
|
|
|
|
|
def test_equality(self, user, case_forms):
|
|
|
|
a = MadeFor(user, case_forms)
|
|
|
|
|
|
|
|
assert a != user and a != case_forms
|
|
|
|
assert hash(a) != hash(user) != hash(case_forms)
|