Skip to content

Commit f31902f

Browse files
committed
tests(cli[load]): Test loading of multiple workspaces
1 parent aaa562c commit f31902f

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tests/test_cli.py

+20-4
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def test_load_symlinked_workspace(
441441

442442
class CLILoadFixture(t.NamedTuple):
443443
test_id: str
444-
cli_args: t.List[str]
444+
cli_args: t.List[t.Union[str, t.List[str]]]
445445
config_paths: t.List[str]
446446
expected_exit_code: int
447447
expected_in_out: "ExpectedOutput" = None
@@ -499,6 +499,20 @@ class CLILoadFixture(t.NamedTuple):
499499
expected_in_out=None,
500500
expected_not_in_out=None,
501501
),
502+
#
503+
# Multiple configs
504+
#
505+
CLILoadFixture(
506+
test_id="configdir-session-name-double",
507+
cli_args=["load", "my_config", "second_config"],
508+
config_paths=[
509+
"{TMUXP_CONFIGDIR}/my_config.yaml",
510+
"{TMUXP_CONFIGDIR}/second_config.yaml",
511+
],
512+
expected_exit_code=0,
513+
expected_in_out=None,
514+
expected_not_in_out=None,
515+
),
502516
]
503517

504518

@@ -533,17 +547,19 @@ def test_load(
533547
)
534548
tmuxp_config.write_text(
535549
"""
536-
session_name: test
550+
session_name: {session_name}
537551
windows:
538552
- window_name: test
539553
panes:
540554
-
541-
""",
555+
""".format(
556+
session_name=pathlib.Path(config_path).name.replace(".", "")
557+
),
542558
encoding="utf-8",
543559
)
544560

545561
try:
546-
cli.cli([*cli_args, "-d", "-L", server.socket_name])
562+
cli.cli([*cli_args, "-d", "-L", server.socket_name, "-y"])
547563
except SystemExit:
548564
pass
549565

0 commit comments

Comments
 (0)