Skip to content

Commit eab9bbe

Browse files
committed
!squash
1 parent ab700a2 commit eab9bbe

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

tests/test_cli.py

+33-16
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def test_load_symlinked_workspace(
442442
class CLILoadFixture(t.NamedTuple):
443443
test_id: str
444444
cli_args: t.List[str]
445-
config_path: str
445+
config_paths: t.List[str]
446446
expected_exit_code: int
447447
expected_in_out: "ExpectedOutput" = None
448448
expected_not_in_out: "ExpectedOutput" = None
@@ -452,13 +452,29 @@ class CLILoadFixture(t.NamedTuple):
452452

453453
TEST_LOAD_FIXTURES = [
454454
CLILoadFixture(
455-
test_id="exists",
455+
test_id="relative-dot-samedir",
456456
cli_args=["load", "."],
457-
config_path="{tmp_path}/.tmuxp.yaml",
457+
config_paths=["{tmp_path}/.tmuxp.yaml"],
458458
expected_exit_code=0,
459459
expected_in_out=None,
460460
expected_not_in_out=None,
461-
)
461+
),
462+
CLILoadFixture(
463+
test_id="relative-dot-slash-samedir",
464+
cli_args=["load", "./"],
465+
config_paths=["{tmp_path}/.tmuxp.yaml"],
466+
expected_exit_code=0,
467+
expected_in_out=None,
468+
expected_not_in_out=None,
469+
),
470+
CLILoadFixture(
471+
test_id="relative-file-samedir",
472+
cli_args=["load", "./.tmuxp.yaml"],
473+
config_paths=["{tmp_path}/.tmuxp.yaml"],
474+
expected_exit_code=0,
475+
expected_in_out=None,
476+
expected_not_in_out=None,
477+
),
462478
]
463479

464480

@@ -475,7 +491,7 @@ def test_load(
475491
monkeypatch: pytest.MonkeyPatch,
476492
test_id: str,
477493
cli_args: t.List[str],
478-
config_path: str,
494+
config_paths: t.List[str],
479495
expected_exit_code: int,
480496
expected_in_out: "ExpectedOutput",
481497
expected_not_in_out: "ExpectedOutput",
@@ -485,17 +501,18 @@ def test_load(
485501
assert server.socket_name is not None
486502

487503
monkeypatch.chdir(tmp_path)
488-
tmuxp_config = pathlib.Path(config_path.format(tmp_path=tmp_path))
489-
tmuxp_config.write_text(
490-
"""
491-
session_name: test
492-
windows:
493-
- window_name: test
494-
panes:
495-
-
496-
""",
497-
encoding="utf-8",
498-
)
504+
for config_path in config_paths:
505+
tmuxp_config = pathlib.Path(config_path.format(tmp_path=tmp_path))
506+
tmuxp_config.write_text(
507+
"""
508+
session_name: test
509+
windows:
510+
- window_name: test
511+
panes:
512+
-
513+
""",
514+
encoding="utf-8",
515+
)
499516

500517
try:
501518
cli.cli([*cli_args, "-d", "-L", server.socket_name])

0 commit comments

Comments
 (0)