@@ -188,12 +188,12 @@ def test_focus_pane_index(self):
188
188
self .assertNotEqual (w .get ('window_name' ), 'man' )
189
189
190
190
pane_path = '/usr'
191
- for i in range (60 ):
191
+ for i in range (10 ):
192
192
p = w .attached_pane ()
193
193
p .server ._update_panes ()
194
194
if p .get ('pane_current_path' ) == pane_path :
195
195
break
196
- time .sleep (.2 )
196
+ time .sleep (.4 )
197
197
198
198
self .assertEqual (p .get ('pane_current_path' ), pane_path )
199
199
@@ -206,12 +206,12 @@ def test_focus_pane_index(self):
206
206
207
207
p = None
208
208
pane_path = '/'
209
- for i in range (60 ):
209
+ for i in range (10 ):
210
210
p = window3 .attached_pane ()
211
211
p .server ._update_panes ()
212
212
if p .get ('pane_current_path' ) == pane_path :
213
213
break
214
- time .sleep (.2 )
214
+ time .sleep (.4 )
215
215
216
216
self .assertEqual (p .get ('pane_current_path' ), pane_path )
217
217
@@ -308,31 +308,31 @@ def test_automatic_rename_option(self):
308
308
if 'BSD' in platform .system ():
309
309
man_window_name = 'less'
310
310
311
- for i in range (60 ):
311
+ for i in range (10 ):
312
312
self .session .server ._update_windows ()
313
313
if w .get ('window_name' ) != man_window_name :
314
314
break
315
- time .sleep (.1 )
315
+ time .sleep (.2 )
316
316
317
317
self .assertNotEqual (w .get ('window_name' ), man_window_name )
318
318
319
319
pane_base_index = w .show_window_option ('pane-base-index' , g = True )
320
320
w .select_pane (pane_base_index )
321
321
322
- for i in range (60 ):
322
+ for i in range (10 ):
323
323
self .session .server ._update_windows ()
324
324
if w .get ('window_name' ) == man_window_name :
325
325
break
326
- time .sleep (.1 )
326
+ time .sleep (.2 )
327
327
328
328
self .assertEqual (w .get ('window_name' ), text_type (man_window_name ))
329
329
330
330
w .select_pane ('-D' )
331
- for i in range (60 ):
331
+ for i in range (10 ):
332
332
self .session .server ._update_windows ()
333
333
if w ['window_name' ] != man_window_name :
334
334
break
335
- time .sleep (.1 )
335
+ time .sleep (.2 )
336
336
337
337
self .assertNotEqual (w .get ('window_name' ), text_type (man_window_name ))
338
338
@@ -375,9 +375,9 @@ class StartDirectoryTest(TmuxTestCase):
375
375
start_directory: '/usr'
376
376
windows:
377
377
- window_name: supposed to be /usr/bin
378
- start_directory: '/usr/bin'
379
- layout: main-horizontal
380
378
window_index: 1
379
+ start_directory: /usr/bin
380
+ layout: main-horizontal
381
381
options:
382
382
main-pane-height: 50
383
383
panes:
@@ -386,9 +386,9 @@ class StartDirectoryTest(TmuxTestCase):
386
386
- shell_command:
387
387
- echo "moo"
388
388
- window_name: support to be /dev
389
- start_directory: '/dev'
390
- layout: main-horizontal
391
389
window_index: 2
390
+ start_directory: /dev
391
+ layout: main-horizontal
392
392
panes:
393
393
- shell_command:
394
394
- pwd
@@ -397,9 +397,9 @@ class StartDirectoryTest(TmuxTestCase):
397
397
- shell_command:
398
398
- echo "moo"
399
399
- window_name: cwd containing a space
400
+ window_index: 3
400
401
start_directory: {TEST_DIR}
401
402
layout: main-horizontal
402
- window_index: 3
403
403
panes:
404
404
- shell_command:
405
405
- pwd
@@ -408,19 +408,19 @@ class StartDirectoryTest(TmuxTestCase):
408
408
- shell_command:
409
409
- echo "moo"
410
410
- window_name: testsa3
411
- layout: main-horizontal
412
411
window_index: 4
412
+ layout: main-horizontal
413
413
panes:
414
414
- shell_command:
415
415
- pwd
416
416
- shell_command:
417
417
- echo "hey"
418
418
- shell_command:
419
419
- echo "moo3"
420
- - window_name: cwd relative to config file
420
+ - window_name: cwd relative to start_directory since no rel dir entered
421
+ window_index: 5
421
422
layout: main-horizontal
422
423
start_directory: ./
423
- window_index: 5
424
424
panes:
425
425
- shell_command:
426
426
- pwd
@@ -466,22 +466,23 @@ def test_start_directory(self):
466
466
dirs = [
467
467
'/usr/bin' , '/dev' , self .test_dir ,
468
468
'/usr' ,
469
- os . getcwd (),
469
+ '/usr'
470
470
]
471
471
472
472
for path , window in zip (dirs , self .session .windows ):
473
473
for p in window .panes :
474
474
for i in range (60 ):
475
475
p .server ._update_panes ()
476
- if p .get ('pane_current_path' ) is None :
476
+ pane_path = p .get ('pane_current_path' )
477
+ if pane_path is None :
477
478
pass
478
479
elif (
479
- path in p . get ( 'pane_current_path' ) or
480
- p . get ( 'pane_current_path' ) == path
480
+ path in pane_path or
481
+ pane_path == path
481
482
):
482
483
result = (
483
- path in p . get ( 'pane_current_path' ) or
484
- p . get ( 'pane_current_path' ) == path
484
+ path == pane_path or
485
+ path in pane_path
485
486
)
486
487
break
487
488
time .sleep (.2 )
@@ -516,7 +517,6 @@ class StartDirectoryRelativeTest(TmuxTestCase):
516
517
- echo "hey"
517
518
- shell_command:
518
519
- echo "moo"
519
- window_index: 1
520
520
- window_name: support to be /dev
521
521
start_directory: '/dev'
522
522
layout: main-horizontal
@@ -527,7 +527,6 @@ class StartDirectoryRelativeTest(TmuxTestCase):
527
527
- echo "hey"
528
528
- shell_command:
529
529
- echo "moo"
530
- window_index: 2
531
530
- window_name: cwd containing a space
532
531
start_directory: {TEST_DIR}
533
532
layout: main-horizontal
@@ -538,8 +537,7 @@ class StartDirectoryRelativeTest(TmuxTestCase):
538
537
- echo "hey"
539
538
- shell_command:
540
539
- echo "moo"
541
- window_index: 3
542
- - window_name: testsa3
540
+ - window_name: inherit start_directory which is rel to config file
543
541
layout: main-horizontal
544
542
panes:
545
543
- shell_command:
@@ -548,7 +546,6 @@ class StartDirectoryRelativeTest(TmuxTestCase):
548
546
- echo "hey"
549
547
- shell_command:
550
548
- echo "moo3"
551
- window_index: 4
552
549
- window_name: cwd relative to config file
553
550
layout: main-horizontal
554
551
start_directory: ./
@@ -559,7 +556,6 @@ class StartDirectoryRelativeTest(TmuxTestCase):
559
556
- echo "hey"
560
557
- shell_command:
561
558
- echo "moo3"
562
- window_index: 5
563
559
"""
564
560
565
561
def setUp (self ):
@@ -613,15 +609,16 @@ def test_start_directory(self):
613
609
assert (self .session == builder .session )
614
610
615
611
dirs = [
616
- '/usr/bin' , '/dev' ,
612
+ '/usr/bin' ,
613
+ '/dev' ,
617
614
self .test_dir ,
618
- os . getcwd () ,
615
+ self . config_dir ,
619
616
self .config_dir ,
620
617
]
621
618
622
619
for path , window in zip (dirs , self .session .windows ):
623
620
for p in window .panes :
624
- for i in range (10 ):
621
+ for i in range (60 ):
625
622
p .server ._update_panes ()
626
623
# Handle case where directories resolve to /private/ in OSX
627
624
pane_path = p .get ('pane_current_path' )
@@ -666,7 +663,6 @@ class PaneOrderingTest(TmuxTestCase):
666
663
HOME = os .path .realpath (os .path .expanduser ('~' ))
667
664
)
668
665
669
-
670
666
def test_pane_order (self ):
671
667
672
668
# test order of `panes` (and pane_index) above aganist pane_dirs
@@ -784,9 +780,9 @@ def test_throw_error_if_retcode_error(self):
784
780
sconfig = kaptan .Kaptan (handler = 'yaml' )
785
781
yaml = self .config_script_fails .format (
786
782
fixtures_dir = fixtures_dir ,
787
- script_failed = os .path .join (fixtures_dir ,'script_failed.sh' )
783
+ script_failed = os .path .join (fixtures_dir , 'script_failed.sh' )
788
784
)
789
- print ( fixtures_dir )
785
+
790
786
sconfig = sconfig .import_config (yaml ).get ()
791
787
sconfig = config .expand (sconfig )
792
788
sconfig = config .trickle (sconfig )
@@ -810,7 +806,7 @@ def test_throw_error_if_file_not_exists(self):
810
806
sconfig = kaptan .Kaptan (handler = 'yaml' )
811
807
yaml = self .config_script_not_exists .format (
812
808
fixtures_dir = fixtures_dir ,
813
- script_not_exists = os .path .join (fixtures_dir ,'script_not_exists.sh' )
809
+ script_not_exists = os .path .join (fixtures_dir , 'script_not_exists.sh' )
814
810
)
815
811
sconfig = sconfig .import_config (yaml ).get ()
816
812
sconfig = config .expand (sconfig )
@@ -833,13 +829,12 @@ def test_throw_error_if_file_not_exists(self):
833
829
msg = "Kills session if before_script doesn't exist"
834
830
)
835
831
836
-
837
832
def test_true_if_test_passes (self ):
838
- assert (os .path .exists (os .path .join (fixtures_dir ,'script_complete.sh' )))
833
+ assert (os .path .exists (os .path .join (fixtures_dir , 'script_complete.sh' )))
839
834
sconfig = kaptan .Kaptan (handler = 'yaml' )
840
835
yaml = self .config_script_completes .format (
841
836
fixtures_dir = fixtures_dir ,
842
- script_complete = os .path .join (fixtures_dir ,'script_complete.sh' )
837
+ script_complete = os .path .join (fixtures_dir , 'script_complete.sh' )
843
838
)
844
839
845
840
sconfig = sconfig .import_config (yaml ).get ()
0 commit comments