-
Notifications
You must be signed in to change notification settings - Fork 237
/
Copy pathtest_example_hierachical.py
58 lines (52 loc) · 1.92 KB
/
test_example_hierachical.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
# -*- coding: utf-8 -*-
import textwrap
from .helpers import keys, create_example_fixture
example_app = create_example_fixture('examples/hierarchical.py')
def test_hierarchical(example_app):
example_app.expect(textwrap.dedent("""\
You find yourself in a small room, there is a door in front of you.
? Which direction would you like to go? (Use arrow keys)
❯ Forward
Right
Left
Back"""))
example_app.write(keys.DOWN)
example_app.write(keys.ENTER)
example_app.expect(textwrap.dedent("""\
? Which direction would you like to go? Right
You cannot go that way. Try again
? Which direction would you like to go? (Use arrow keys)
❯ Forward
Right
Left
Back"""))
example_app.write(keys.ENTER)
example_app.expect(textwrap.dedent("""\
? Which direction would you like to go? Forward
You find yourself in a forest
There is a wolf in front of you; a friendly looking dwarf to the right and an impasse to the left.
? Which direction would you like to go? (Use arrow keys)
❯ Forward
Right
Left
Back"""))
example_app.write(keys.DOWN)
example_app.write(keys.ENTER)
example_app.expect(textwrap.dedent("""\
? Which direction would you like to go? Right
You befriend the dwarf
He helps you kill the wolf. You can now move forward
? Which direction would you like to go? (Use arrow keys)
❯ Forward
Right
Left
Back"""))
example_app.write(keys.ENTER)
example_app.expect(textwrap.dedent("""\
? Which direction would you like to go? Forward
You find a painted wooden sign that says:
____ _____ ____ _____
(_ _)( _ )( _ \\( _ )
)( )(_)( )(_) ))(_)(
(__) (_____)(____/(_____)
"""))