@@ -483,6 +483,22 @@ class CLILoadFixture(t.NamedTuple):
483
483
expected_in_out = None ,
484
484
expected_not_in_out = None ,
485
485
),
486
+ CLILoadFixture (
487
+ test_id = "configdir-session-name" ,
488
+ cli_args = ["load" , "my_config" ],
489
+ config_paths = ["{TMUXP_CONFIGDIR}/my_config.yaml" ],
490
+ expected_exit_code = 0 ,
491
+ expected_in_out = None ,
492
+ expected_not_in_out = None ,
493
+ ),
494
+ CLILoadFixture (
495
+ test_id = "configdir-absolute" ,
496
+ cli_args = ["load" , "~/.config/tmuxp/my_config.yaml" ],
497
+ config_paths = ["{TMUXP_CONFIGDIR}/my_config.yaml" ],
498
+ expected_exit_code = 0 ,
499
+ expected_in_out = None ,
500
+ expected_not_in_out = None ,
501
+ ),
486
502
]
487
503
488
504
@@ -491,8 +507,10 @@ class CLILoadFixture(t.NamedTuple):
491
507
TEST_LOAD_FIXTURES ,
492
508
ids = [test .test_id for test in TEST_LOAD_FIXTURES ],
493
509
)
510
+ @pytest .mark .usefixtures ("tmuxp_configdir_default" )
494
511
def test_load (
495
512
tmp_path : pathlib .Path ,
513
+ tmuxp_configdir : pathlib .Path ,
496
514
server : "Server" ,
497
515
session : Session ,
498
516
capsys : pytest .CaptureFixture ,
@@ -510,7 +528,9 @@ def test_load(
510
528
511
529
monkeypatch .chdir (tmp_path )
512
530
for config_path in config_paths :
513
- tmuxp_config = pathlib .Path (config_path .format (tmp_path = tmp_path ))
531
+ tmuxp_config = pathlib .Path (
532
+ config_path .format (tmp_path = tmp_path , TMUXP_CONFIGDIR = tmuxp_configdir )
533
+ )
514
534
tmuxp_config .write_text (
515
535
"""
516
536
session_name: test
0 commit comments