1818sampleconfigdict = {
1919 'session_name' : 'sampleconfig' ,
2020 'start_directory' : '~' ,
21- 'windows' : [{
22- 'window_name' : 'editor' ,
23- 'panes' : [
24- {
25- 'start_directory' : '~' , 'shell_command' : ['vim' ],
21+ 'windows' : [
22+ {
23+ 'window_name' : 'editor' ,
24+ 'panes' : [
25+ {
26+ 'start_directory' : '~' ,
27+ 'shell_command' : ['vim' ],
2628 }, {
27- 'shell_command' : ['cowsay "hey"' ]
29+ 'shell_command' : ['cowsay "hey"' ]
30+ },
31+ ],
32+ 'layout' : 'main-verticle'
33+ },
34+ {
35+ 'window_name' : 'logging' ,
36+ 'panes' : [{
37+ 'shell_command' : ['tail -F /var/log/syslog' ],
38+ 'start_directory' :'/var/log'
39+ }]
40+ },
41+ {
42+ 'options' : {
43+ 'automatic_rename' : True ,
2844 },
29- ],
30- 'layout' : 'main-verticle' },
31- {'window_name' : 'logging' , 'panes' : [
32- {'shell_command' : ['tail -F /var/log/syslog' ],
33- 'start_directory' :'/var/log' }
34- ]}, {
35- 'options' : {
36- 'automatic_rename' : True ,
37- },
3845 'panes' : [
3946 {'shell_command' : ['htop' ]}
4047 ]
41- }]
48+ }
49+ ]
4250}
4351
4452
@@ -161,17 +169,19 @@ class ExpandTest(unittest.TestCase):
161169 after_config = {
162170 'session_name' : 'sampleconfig' ,
163171 'start_directory' : '~' ,
164- 'windows' : [{
165- 'shell_command' : ['top' ],
166- 'window_name' : 'editor' ,
167- 'panes' : [
168- {
169- 'start_directory' : '~' , 'shell_command' : ['vim' ],
172+ 'windows' : [
173+ {
174+ 'shell_command' : ['top' ],
175+ 'window_name' : 'editor' ,
176+ 'panes' : [
177+ {
178+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
170179 }, {
171- 'shell_command' : ['cowsay "hey"' ]
172- },
173- ],
174- 'layout' : 'main-verticle' },
180+ 'shell_command' : ['cowsay "hey"' ]
181+ },
182+ ],
183+ 'layout' : 'main-verticle'
184+ },
175185 {
176186 'window_name' : 'logging' ,
177187 'panes' : [
@@ -185,7 +195,8 @@ class ExpandTest(unittest.TestCase):
185195 {'shell_command' : ['htop' ]},
186196 {'shell_command' : ['vim' ]}
187197 ]
188- }]
198+ }
199+ ]
189200 }
190201
191202 def test_config (self ):
@@ -204,17 +215,19 @@ class InlineTest(unittest.TestCase):
204215 before_config = {
205216 'session_name' : 'sampleconfig' ,
206217 'start_directory' : '~' ,
207- 'windows' : [{
208- 'shell_command' : ['top' ],
209- 'window_name' : 'editor' ,
210- 'panes' : [
211- {
212- 'start_directory' : '~' , 'shell_command' : ['vim' ],
218+ 'windows' : [
219+ {
220+ 'shell_command' : ['top' ],
221+ 'window_name' : 'editor' ,
222+ 'panes' : [
223+ {
224+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
213225 }, {
214- 'shell_command' : ['cowsay "hey"' ]
215- },
216- ],
217- 'layout' : 'main-verticle' },
226+ 'shell_command' : ['cowsay "hey"' ]
227+ },
228+ ],
229+ 'layout' : 'main-verticle'
230+ },
218231 {
219232 'window_name' : 'logging' ,
220233 'panes' : [
@@ -227,23 +240,26 @@ class InlineTest(unittest.TestCase):
227240 'panes' : [
228241 {'shell_command' : ['htop' ]}
229242 ]
230- }]
243+ }
244+ ]
231245 }
232246
233247 after_config = {
234248 'session_name' : 'sampleconfig' ,
235249 'start_directory' : '~' ,
236- 'windows' : [{
237- 'shell_command' : 'top' ,
238- 'window_name' : 'editor' ,
239- 'panes' : [
240- {
241- 'start_directory' : '~' , 'shell_command' : 'vim' ,
250+ 'windows' : [
251+ {
252+ 'shell_command' : 'top' ,
253+ 'window_name' : 'editor' ,
254+ 'panes' : [
255+ {
256+ 'start_directory' : '~' , 'shell_command' : 'vim' ,
242257 }, {
243- 'shell_command' : 'cowsay "hey"'
244- },
245- ],
246- 'layout' : 'main-verticle' },
258+ 'shell_command' : 'cowsay "hey"'
259+ },
260+ ],
261+ 'layout' : 'main-verticle'
262+ },
247263 {
248264 'window_name' : 'logging' ,
249265 'panes' : [
@@ -256,7 +272,8 @@ class InlineTest(unittest.TestCase):
256272 'panes' : [
257273 {'shell_command' : 'htop' }
258274 ]
259- }]
275+ }
276+ ]
260277 }
261278
262279 def test_config (self ):
@@ -279,17 +296,19 @@ class InheritanceTest(unittest.TestCase):
279296 config_before = {
280297 'session_name' : 'sampleconfig' ,
281298 'start_directory' : '/' ,
282- 'windows' : [{
283- 'window_name' : 'editor' ,
284- 'start_directory' : '~' ,
285- 'panes' : [
286- {
287- 'start_directory' : '~' , 'shell_command' : ['vim' ],
299+ 'windows' : [
300+ {
301+ 'window_name' : 'editor' ,
302+ 'start_directory' : '~' ,
303+ 'panes' : [
304+ {
305+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
288306 }, {
289- 'shell_command' : ['cowsay "hey"' ]
290- },
291- ],
292- 'layout' : 'main-verticle' },
307+ 'shell_command' : ['cowsay "hey"' ]
308+ },
309+ ],
310+ 'layout' : 'main-verticle'
311+ },
293312 {
294313 'window_name' : 'logging' ,
295314 'panes' : [
@@ -308,23 +327,26 @@ class InheritanceTest(unittest.TestCase):
308327 'panes' : [
309328 {'shell_command' : ['htop' ]}
310329 ]
311- }]
330+ }
331+ ]
312332 }
313333
314334 config_after = {
315335 'session_name' : 'sampleconfig' ,
316336 'start_directory' : '/' ,
317- 'windows' : [{
318- 'window_name' : 'editor' ,
319- 'start_directory' : '~' ,
320- 'panes' : [
321- {
322- 'start_directory' : '~' , 'shell_command' : ['vim' ],
337+ 'windows' : [
338+ {
339+ 'window_name' : 'editor' ,
340+ 'start_directory' : '~' ,
341+ 'panes' : [
342+ {
343+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
323344 }, {
324- 'shell_command' : ['cowsay "hey"' ], 'start_directory' : '~' ,
325- },
326- ],
327- 'layout' : 'main-verticle' },
345+ 'shell_command' : ['cowsay "hey"' ], 'start_directory' : '~' ,
346+ },
347+ ],
348+ 'layout' : 'main-verticle'
349+ },
328350 {
329351 'window_name' : 'logging' ,
330352 'panes' : [
@@ -343,7 +365,8 @@ class InheritanceTest(unittest.TestCase):
343365 'panes' : [
344366 {'shell_command' : ['htop' ], 'start_directory' :'/' }
345367 ]
346- }]
368+ }
369+ ]
347370 }
348371
349372 def test_start_directory (self ):
@@ -384,18 +407,20 @@ class ShellCommandBeforeTest(unittest.TestCase):
384407 config_unexpanded = { # shell_command_before is string in some areas
385408 'session_name' : 'sampleconfig' ,
386409 'start_directory' : '/' ,
387- 'windows' : [{
388- 'window_name' : 'editor' ,
389- 'start_directory' : '~' ,
390- 'shell_command_before' : 'source .env/bin/activate' ,
391- 'panes' : [
392- {
393- 'start_directory' : '~' , 'shell_command' : ['vim' ],
410+ 'windows' : [
411+ {
412+ 'window_name' : 'editor' ,
413+ 'start_directory' : '~' ,
414+ 'shell_command_before' : 'source .env/bin/activate' ,
415+ 'panes' : [
416+ {
417+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
394418 }, {
395- 'shell_command_before' : ['rbenv local 2.0.0-p0' ], 'shell_command' : ['cowsay "hey"' ]
396- },
397- ],
398- 'layout' : 'main-verticle' },
419+ 'shell_command_before' : ['rbenv local 2.0.0-p0' ], 'shell_command' : ['cowsay "hey"' ]
420+ },
421+ ],
422+ 'layout' : 'main-verticle'
423+ },
399424 {
400425 'shell_command_before' : 'rbenv local 2.0.0-p0' ,
401426 'window_name' : 'logging' ,
@@ -419,24 +444,27 @@ class ShellCommandBeforeTest(unittest.TestCase):
419444 'panes' : [
420445 {'shell_command' : ['htop' ]}
421446 ]
422- }]
447+ }
448+ ]
423449 }
424450
425451 config_expanded = { # shell_command_before is string in some areas
426452 'session_name' : 'sampleconfig' ,
427453 'start_directory' : '/' ,
428- 'windows' : [{
429- 'window_name' : 'editor' ,
430- 'start_directory' : '~' ,
431- 'shell_command_before' : ['source .env/bin/activate' ],
432- 'panes' : [
433- {
434- 'start_directory' : '~' , 'shell_command' : ['vim' ],
454+ 'windows' : [
455+ {
456+ 'window_name' : 'editor' ,
457+ 'start_directory' : '~' ,
458+ 'shell_command_before' : ['source .env/bin/activate' ],
459+ 'panes' : [
460+ {
461+ 'start_directory' : '~' , 'shell_command' : ['vim' ],
435462 }, {
436- 'shell_command_before' : ['rbenv local 2.0.0-p0' ], 'shell_command' : ['cowsay "hey"' ]
437- },
438- ],
439- 'layout' : 'main-verticle' },
463+ 'shell_command_before' : ['rbenv local 2.0.0-p0' ], 'shell_command' : ['cowsay "hey"' ]
464+ },
465+ ],
466+ 'layout' : 'main-verticle'
467+ },
440468 {
441469 'shell_command_before' : ['rbenv local 2.0.0-p0' ],
442470 'window_name' : 'logging' ,
@@ -460,24 +488,32 @@ class ShellCommandBeforeTest(unittest.TestCase):
460488 'panes' : [
461489 {'shell_command' : ['htop' ]}
462490 ]
463- }]
491+ }
492+ ]
464493 }
465494
466495 config_after = { # shell_command_before is string in some areas
467496 'session_name' : 'sampleconfig' ,
468497 'start_directory' : '/' ,
469- 'windows' : [{
470- 'window_name' : 'editor' ,
471- 'start_directory' : '~' ,
472- 'shell_command_before' : ['source .env/bin/activate' ],
473- 'panes' : [
474- {
475- 'start_directory' : '~' , 'shell_command' : ['source .env/bin/activate' , 'vim' ],
498+ 'windows' : [
499+ {
500+ 'window_name' : 'editor' ,
501+ 'start_directory' : '~' ,
502+ 'shell_command_before' : ['source .env/bin/activate' ],
503+ 'panes' : [
504+ {
505+ 'start_directory' : '~' ,
506+ 'shell_command' : ['source .env/bin/activate' , 'vim' ],
476507 }, {
477- 'shell_command_before' : ['rbenv local 2.0.0-p0' ], 'shell_command' : ['source .env/bin/activate' , 'rbenv local 2.0.0-p0' , 'cowsay "hey"' ]
478- },
479- ],
480- 'layout' : 'main-verticle' },
508+ 'shell_command_before' : ['rbenv local 2.0.0-p0' ],
509+ 'shell_command' : [
510+ 'source .env/bin/activate' ,
511+ 'rbenv local 2.0.0-p0' , 'cowsay "hey"'
512+ ]
513+ },
514+ ],
515+ 'layout' : 'main-verticle'
516+ },
481517 {
482518 'shell_command_before' : ['rbenv local 2.0.0-p0' ],
483519 'window_name' : 'logging' ,
@@ -501,7 +537,8 @@ class ShellCommandBeforeTest(unittest.TestCase):
501537 'panes' : [
502538 {'shell_command' : ['htop' ]}
503539 ]
504- }]
540+ }
541+ ]
505542 }
506543
507544 def test_shell_command_before (self ):
0 commit comments