-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
75 lines (60 loc) · 1.91 KB
/
tests.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from states import Ordering
import pytest
class Tests:
pass
def send_message_result(text, _):
print(text)
def test_init():
order = Ordering(send_message_result, 0)
assert order.state == 'start'
order.start()
def test_dialog_1():
order = Ordering(send_message_result, 0)
assert order.state == 'start'
order.start()
assert order.state == 'pizza_size'
order.get_message('Большую')
assert order.state == 'pay_type'
order.get_message('Картой')
assert order.state == 'confirm'
order.get_message('да')
assert order.state == 'end'
def test_dialog_2():
order = Ordering(send_message_result, 0)
assert order.state == 'start'
order.start()
assert order.state == 'pizza_size'
order.get_message('маленькую')
assert order.state == 'pay_type'
order.get_message('наличкой')
assert order.state == 'confirm'
order.get_message('да')
assert order.state == 'end'
def test_dialog_3():
order = Ordering(send_message_result, 0)
assert order.state == 'start'
order.start()
assert order.state == 'pizza_size'
order.get_message('hi')
assert order.state == 'pizza_size'
order.get_message('hi')
assert order.state == 'pizza_size'
order.get_message('Большую')
assert order.state == 'pay_type'
order.get_message('Картой')
assert order.state == 'confirm'
order.get_message('да')
assert order.state == 'end'
def test_dialog_4():
order = Ordering(send_message_result, 0)
assert order.state == 'start'
order.start()
assert order.state == 'pizza_size'
order.get_message('Большую')
assert order.state == 'pay_type'
order.get_message('Точно не картой')
assert order.state == 'pay_type'
order.get_message('картой')
assert order.state == 'confirm'
order.get_message('да')
assert order.state == 'end'