13
13
logger = logging .getLogger (__name__ )
14
14
TMUXP_DIR = os .path .join (os .path .dirname (__file__ ), '.tmuxp' )
15
15
current_dir = os .path .abspath (os .path .dirname (__file__ ))
16
- example_dir = os .path .abspath (os .path .join (current_dir , '..' , '..' , 'examples' ))
16
+ example_dir = os .path .abspath (os .path .join (
17
+ current_dir , '..' , '..' , 'examples' ))
17
18
18
19
19
20
sampleconfigdict = {
@@ -139,12 +140,17 @@ class ExpandTest(TestCase):
139
140
'session_name' : 'sampleconfig' ,
140
141
'start_directory' : '~' ,
141
142
'windows' : [{
142
- 'shell_command' : 'top' ,
143
143
'window_name' : 'editor' ,
144
144
'panes' : [
145
+ {
146
+ 'shell_command' : [
147
+ 'vim' ,
148
+ 'top'
149
+ ]
150
+ },
145
151
{
146
152
'shell_command' : ['vim' ],
147
- },
153
+ },
148
154
{
149
155
'shell_command' : 'cowsay "hey"'
150
156
},
@@ -200,12 +206,15 @@ class ExpandTest(TestCase):
200
206
'start_directory' : '~' ,
201
207
'windows' : [
202
208
{
203
- 'shell_command' : ['top' ],
204
209
'window_name' : 'editor' ,
205
210
'panes' : [
211
+ {
212
+ 'shell_command' : ['vim' , 'top' ],
213
+ },
206
214
{
207
215
'shell_command' : ['vim' ],
208
- }, {
216
+ },
217
+ {
209
218
'shell_command' : ['cowsay "hey"' ]
210
219
},
211
220
],
@@ -274,7 +283,7 @@ class InlineTest(TestCase):
274
283
'window_name' : 'editor' ,
275
284
'panes' : [
276
285
{
277
- 'start_directory' : '~' , ' shell_command' : ['vim' ],
286
+ 'shell_command' : ['vim' ],
278
287
}, {
279
288
'shell_command' : ['cowsay "hey"' ]
280
289
},
@@ -284,8 +293,9 @@ class InlineTest(TestCase):
284
293
{
285
294
'window_name' : 'logging' ,
286
295
'panes' : [
287
- {'shell_command' : ['tail -F /var/log/syslog' ],
288
- 'start_directory' :'/var/log' }
296
+ {
297
+ 'shell_command' : ['tail -F /var/log/syslog' ],
298
+ }
289
299
]
290
300
},
291
301
{
@@ -305,35 +315,26 @@ class InlineTest(TestCase):
305
315
'shell_command' : 'top' ,
306
316
'window_name' : 'editor' ,
307
317
'panes' : [
308
- {
309
- 'start_directory' : '~' ,
310
- 'shell_command' : 'vim' ,
311
- },
312
- {
313
- 'shell_command' : 'cowsay "hey"'
314
- },
318
+ 'vim' ,
319
+ 'cowsay "hey"'
315
320
],
316
321
'layout' : 'main-verticle'
317
322
},
318
323
{
319
324
'window_name' : 'logging' ,
320
325
'panes' : [
321
- {
322
- 'shell_command' : 'tail -F /var/log/syslog' ,
323
- 'start_directory' : '/var/log'
324
- }
326
+ 'tail -F /var/log/syslog' ,
325
327
]
326
328
},
327
329
{
328
330
'options' : {
329
331
'automatic_rename' : True ,
330
332
},
331
333
'panes' : [
332
- {
333
- 'shell_command' : 'htop'
334
- }
334
+ 'htop'
335
335
]
336
- }
336
+ },
337
+
337
338
]
338
339
}
339
340
@@ -358,7 +359,6 @@ class InheritanceTest(TestCase):
358
359
'start_directory' : '~' ,
359
360
'panes' : [
360
361
{
361
- 'start_directory' : '~' ,
362
362
'shell_command' : ['vim' ],
363
363
},
364
364
{
@@ -372,7 +372,6 @@ class InheritanceTest(TestCase):
372
372
'panes' : [
373
373
{
374
374
'shell_command' : ['tail -F /var/log/syslog' ],
375
- 'start_directory' :'/var/log'
376
375
}
377
376
]
378
377
},
@@ -381,7 +380,6 @@ class InheritanceTest(TestCase):
381
380
'panes' : [
382
381
{
383
382
'shell_command' : ['htop' ],
384
- 'start_directory' : '/etc/'
385
383
}
386
384
]
387
385
},
@@ -407,9 +405,9 @@ class InheritanceTest(TestCase):
407
405
'start_directory' : '~' ,
408
406
'panes' : [
409
407
{
410
- 'start_directory' : '~' , ' shell_command' : ['vim' ],
408
+ 'shell_command' : ['vim' ],
411
409
}, {
412
- 'shell_command' : ['cowsay "hey"' ], 'start_directory' : '~' ,
410
+ 'shell_command' : ['cowsay "hey"' ],
413
411
},
414
412
],
415
413
'layout' : 'main-verticle'
@@ -419,23 +417,22 @@ class InheritanceTest(TestCase):
419
417
'panes' : [
420
418
{
421
419
'shell_command' : ['tail -F /var/log/syslog' ],
422
- 'start_directory' :'/var/log'
423
420
}
424
421
]
425
422
},
426
423
{
427
424
'window_name' : 'shufu' ,
428
425
'panes' : [
429
426
{
430
- 'shell_command' : ['htop' ], 'start_directory' : '/etc/'
427
+ 'shell_command' : ['htop' ],
431
428
}
432
429
]
433
430
},
434
431
{
435
432
'options' : {'automatic_rename' : True , },
436
433
'panes' : [
437
434
{
438
- 'shell_command' : ['htop' ], 'start_directory' : '/'
435
+ 'shell_command' : ['htop' ],
439
436
}
440
437
]
441
438
}
@@ -458,12 +455,13 @@ def test_start_directory(self):
458
455
window_start_directory = session_start_directory
459
456
460
457
for paneconfitem in windowconfitem ['panes' ]:
461
- if 'start_directory' in paneconfitem :
462
- pane_start_directory = paneconfitem ['start_directory' ]
463
- elif window_start_directory :
464
- paneconfitem ['start_directory' ] = window_start_directory
465
- elif session_start_directory :
466
- paneconfitem ['start_directory' ] = session_start_directory
458
+ # if 'start_directory' in paneconfitem:
459
+ # pane_start_directory = paneconfitem['start_directory']
460
+ # elif window_start_directory:
461
+ # paneconfitem['start_directory'] = window_start_directory
462
+ # elif session_start_directory:
463
+ # paneconfitem['start_directory'] = session_start_directory
464
+ pass
467
465
468
466
self .maxDiff = None
469
467
self .assertDictEqual (config , self .config_after )
@@ -813,7 +811,8 @@ def test_expands_blank(self):
813
811
814
812
self .maxDiff = None
815
813
816
- test_config = kaptan .Kaptan ().import_config (self .yaml_config_file ).get ()
814
+ test_config = kaptan .Kaptan ().import_config (
815
+ self .yaml_config_file ).get ()
817
816
818
817
self .assertDictEqual (
819
818
config .expand (test_config ),
0 commit comments