Skip to content

Commit d9b1de0

Browse files
committed
Finish test_config py.test fixturization/function conversion
1 parent 9314c5c commit d9b1de0

File tree

4 files changed

+253
-268
lines changed

4 files changed

+253
-268
lines changed

tests/fixtures/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from . import (expand1, expand2, shell_command_before, # noqa
2-
shell_command_before_session, sampleconfig)
1+
from . import (expand1, expand2, expand_blank, sampleconfig, # noqa
2+
shell_command_before, shell_command_before_session, trickle)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
expected = {
2+
'session_name': 'Blank pane test',
3+
'windows': [
4+
{
5+
'window_name': 'Blank pane test',
6+
'panes': [
7+
{
8+
'shell_command': [],
9+
},
10+
{
11+
'shell_command': [],
12+
},
13+
{
14+
'shell_command': [],
15+
}
16+
]
17+
},
18+
{
19+
'window_name': 'More blank panes',
20+
'panes': [
21+
{
22+
'shell_command': [],
23+
},
24+
{
25+
'shell_command': [],
26+
},
27+
{
28+
'shell_command': [],
29+
}
30+
]
31+
},
32+
{
33+
'window_name': 'Empty string (return)',
34+
'panes': [
35+
{
36+
'shell_command': [
37+
''
38+
],
39+
},
40+
{
41+
'shell_command': [
42+
''
43+
],
44+
},
45+
{
46+
'shell_command': [
47+
''
48+
],
49+
}
50+
]
51+
},
52+
{
53+
'window_name': 'Blank with options',
54+
'panes': [
55+
{
56+
'shell_command': [],
57+
'focus': True,
58+
},
59+
{
60+
'shell_command': [],
61+
'start_directory': '/tmp',
62+
}
63+
]
64+
}
65+
]
66+
}

tests/fixtures/config/trickle.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
before = { # shell_command_before is string in some areas
2+
'session_name': 'sampleconfig',
3+
'start_directory': '/var',
4+
'windows': [
5+
{
6+
'window_name': 'editor',
7+
'start_directory': 'log',
8+
'panes': [
9+
{
10+
'shell_command': ['vim'],
11+
},
12+
{
13+
'shell_command': ['cowsay "hey"']
14+
},
15+
],
16+
'layout': 'main-verticle'
17+
},
18+
{
19+
'window_name': 'logging',
20+
'start_directory': '~',
21+
'panes': [
22+
{
23+
'shell_command': ['tail -F /var/log/syslog'],
24+
},
25+
{
26+
'shell_command': []
27+
}
28+
]
29+
},
30+
]
31+
}
32+
33+
expected = { # shell_command_before is string in some areas
34+
'session_name': 'sampleconfig',
35+
'start_directory': '/var',
36+
'windows': [
37+
{
38+
'window_name': 'editor',
39+
'start_directory': '/var/log',
40+
'panes': [
41+
{
42+
'shell_command': ['vim'],
43+
},
44+
{
45+
'shell_command': [
46+
'cowsay "hey"'
47+
]
48+
},
49+
],
50+
'layout': 'main-verticle'
51+
},
52+
{
53+
'start_directory': '~',
54+
'window_name': 'logging',
55+
'panes': [
56+
{
57+
'shell_command': ['tail -F /var/log/syslog'],
58+
},
59+
{
60+
'shell_command': []
61+
}
62+
]
63+
},
64+
]
65+
}

0 commit comments

Comments
 (0)