2019-11-08 02:09:39 +09:00
|
|
|
from yandex_music import PassportPhone
|
|
|
|
|
|
|
|
|
|
|
|
class TestPassportPhone:
|
2019-11-08 06:37:53 +09:00
|
|
|
phone = '+375295773423'
|
2019-11-08 02:09:39 +09:00
|
|
|
|
|
|
|
def test_expected_values(self, passport_phone):
|
|
|
|
assert passport_phone.phone == self.phone
|
|
|
|
|
2019-12-29 16:38:24 +09:00
|
|
|
def test_de_json_none(self, client):
|
|
|
|
assert PassportPhone.de_json({}, client) is None
|
|
|
|
|
2019-12-29 17:06:27 +09:00
|
|
|
def test_de_list_none(self, client):
|
|
|
|
assert PassportPhone.de_list({}, client) == []
|
|
|
|
|
2019-11-08 02:09:39 +09:00
|
|
|
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):
|
2019-11-08 06:37:53 +09:00
|
|
|
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
|