-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
test_made_for.py
30 lines (21 loc) · 1.05 KB
/
test_made_for.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
def test_de_json_none(self, client):
assert MadeFor.de_json({}, client) is None
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)