-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
test_deactivation.py
40 lines (28 loc) · 1.31 KB
/
test_deactivation.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
38
39
40
from yandex_music import Deactivation
class TestDeactivation:
method = 'ussd'
instructions = 'Отключение услуги: *301# (недоступно в роуминге)'
def test_expected_values(self, deactivation):
assert deactivation.method == self.method
assert deactivation.instructions == self.instructions
def test_de_json_none(self, client):
assert Deactivation.de_json({}, client) is None
def test_de_list_none(self, client):
assert Deactivation.de_list([], client) == []
def test_de_json_required(self, client):
json_dict = {'method': self.method}
deactivation = Deactivation.de_json(json_dict, client)
assert deactivation.method == self.method
def test_de_json_all(self, client):
json_dict = {'method': self.method, 'instructions': self.instructions}
deactivation = Deactivation.de_json(json_dict, client)
assert deactivation.method == self.method
assert deactivation.instructions == self.instructions
def test_equality(self):
a = Deactivation(self.method, self.instructions)
b = Deactivation('', self.instructions)
c = Deactivation(self.method, self.instructions)
assert a != b
assert hash(a) != hash(b)
assert a is not b
assert a == c