-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
test_passport_phone.py
37 lines (25 loc) · 1.02 KB
/
test_passport_phone.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
31
32
33
34
35
36
37
from yandex_music import PassportPhone
class TestPassportPhone:
phone = '+375295773423'
def test_expected_values(self, passport_phone):
assert passport_phone.phone == self.phone
def test_de_json_none(self, client):
assert PassportPhone.de_json({}, client) is None
def test_de_list_none(self, client):
assert PassportPhone.de_list([], client) == []
def test_de_json_required(self, client):
json_dict = {'phone': self.phone}
passport_phone = PassportPhone.de_json(json_dict, client)
assert passport_phone.phone == self.phone
def test_de_json_all(self, client):
json_dict = {'phone': self.phone}
passport_phone = PassportPhone.de_json(json_dict, client)
assert passport_phone.phone == self.phone
def test_equality(self):
a = PassportPhone(self.phone)
b = PassportPhone('')
c = PassportPhone(self.phone)
assert a != b
assert hash(a) != hash(b)
assert a is not b
assert a == c