@@ -443,6 +443,7 @@ class CLILoadFixture(t.NamedTuple):
443
443
test_id : str
444
444
cli_args : t .List [t .Union [str , t .List [str ]]]
445
445
config_paths : t .List [str ]
446
+ session_names : t .List [str ]
446
447
expected_exit_code : int
447
448
expected_in_out : "ExpectedOutput" = None
448
449
expected_not_in_out : "ExpectedOutput" = None
@@ -455,6 +456,7 @@ class CLILoadFixture(t.NamedTuple):
455
456
test_id = "dir-relative-dot-samedir" ,
456
457
cli_args = ["load" , "." ],
457
458
config_paths = ["{tmp_path}/.tmuxp.yaml" ],
459
+ session_names = ["my_config" ],
458
460
expected_exit_code = 0 ,
459
461
expected_in_out = None ,
460
462
expected_not_in_out = None ,
@@ -463,6 +465,7 @@ class CLILoadFixture(t.NamedTuple):
463
465
test_id = "dir-relative-dot-slash-samedir" ,
464
466
cli_args = ["load" , "./" ],
465
467
config_paths = ["{tmp_path}/.tmuxp.yaml" ],
468
+ session_names = ["my_config" ],
466
469
expected_exit_code = 0 ,
467
470
expected_in_out = None ,
468
471
expected_not_in_out = None ,
@@ -471,6 +474,7 @@ class CLILoadFixture(t.NamedTuple):
471
474
test_id = "dir-relative-file-samedir" ,
472
475
cli_args = ["load" , "./.tmuxp.yaml" ],
473
476
config_paths = ["{tmp_path}/.tmuxp.yaml" ],
477
+ session_names = ["my_config" ],
474
478
expected_exit_code = 0 ,
475
479
expected_in_out = None ,
476
480
expected_not_in_out = None ,
@@ -479,6 +483,7 @@ class CLILoadFixture(t.NamedTuple):
479
483
test_id = "filename-relative-file-samedir" ,
480
484
cli_args = ["load" , "./my_config.yaml" ],
481
485
config_paths = ["{tmp_path}/my_config.yaml" ],
486
+ session_names = ["my_config" ],
482
487
expected_exit_code = 0 ,
483
488
expected_in_out = None ,
484
489
expected_not_in_out = None ,
@@ -487,6 +492,7 @@ class CLILoadFixture(t.NamedTuple):
487
492
test_id = "configdir-session-name" ,
488
493
cli_args = ["load" , "my_config" ],
489
494
config_paths = ["{TMUXP_CONFIGDIR}/my_config.yaml" ],
495
+ session_names = ["my_config" ],
490
496
expected_exit_code = 0 ,
491
497
expected_in_out = None ,
492
498
expected_not_in_out = None ,
@@ -495,6 +501,7 @@ class CLILoadFixture(t.NamedTuple):
495
501
test_id = "configdir-absolute" ,
496
502
cli_args = ["load" , "~/.config/tmuxp/my_config.yaml" ],
497
503
config_paths = ["{TMUXP_CONFIGDIR}/my_config.yaml" ],
504
+ session_names = ["my_config" ],
498
505
expected_exit_code = 0 ,
499
506
expected_in_out = None ,
500
507
expected_not_in_out = None ,
@@ -509,6 +516,7 @@ class CLILoadFixture(t.NamedTuple):
509
516
"{TMUXP_CONFIGDIR}/my_config.yaml" ,
510
517
"{TMUXP_CONFIGDIR}/second_config.yaml" ,
511
518
],
519
+ session_names = ["my_config" , "second_config" ],
512
520
expected_exit_code = 0 ,
513
521
expected_in_out = None ,
514
522
expected_not_in_out = None ,
@@ -532,6 +540,7 @@ def test_load(
532
540
test_id : str ,
533
541
cli_args : t .List [str ],
534
542
config_paths : t .List [str ],
543
+ session_names : t .List [str ],
535
544
expected_exit_code : int ,
536
545
expected_in_out : "ExpectedOutput" ,
537
546
expected_not_in_out : "ExpectedOutput" ,
@@ -541,7 +550,7 @@ def test_load(
541
550
assert server .socket_name is not None
542
551
543
552
monkeypatch .chdir (tmp_path )
544
- for config_path in config_paths :
553
+ for session_name , config_path in zip ( session_names , config_paths ) :
545
554
tmuxp_config = pathlib .Path (
546
555
config_path .format (tmp_path = tmp_path , TMUXP_CONFIGDIR = tmuxp_configdir )
547
556
)
@@ -553,7 +562,7 @@ def test_load(
553
562
panes:
554
563
-
555
564
""" .format (
556
- session_name = pathlib . Path ( config_path ). name . replace ( "." , "" )
565
+ session_name = session_name
557
566
),
558
567
encoding = "utf-8" ,
559
568
)
@@ -578,6 +587,9 @@ def test_load(
578
587
for needle in expected_not_in_out :
579
588
assert needle not in output
580
589
590
+ for session_name in session_names :
591
+ assert server .has_session (session_name )
592
+
581
593
582
594
def test_regression_00132_session_name_with_dots (
583
595
tmp_path : pathlib .Path ,
0 commit comments