|
14 | 14 | from libtmux.common import has_lt_version
|
15 | 15 | from libtmux.exc import LibTmuxException
|
16 | 16 | from libtmux.session import Session
|
| 17 | +from libtmux.server import Server |
17 | 18 | from tmuxp import cli, exc
|
18 | 19 | from tmuxp.cli.import_config import get_teamocil_dir, get_tmuxinator_dir
|
19 | 20 | from tmuxp.cli.load import (
|
@@ -80,6 +81,28 @@ def test_load_workspace(server: "Server", monkeypatch: pytest.MonkeyPatch) -> No
|
80 | 81 | assert session.name == "sample workspace"
|
81 | 82 |
|
82 | 83 |
|
| 84 | +def test_load_workspace_passes_tmux_config( |
| 85 | + server: "Server", monkeypatch: pytest.MonkeyPatch |
| 86 | +) -> None: |
| 87 | + # this is an implementation test. Since this testsuite may be ran within |
| 88 | + # a tmux session by the developer himself, delete the TMUX variable |
| 89 | + # temporarily. |
| 90 | + monkeypatch.delenv("TMUX", raising=False) |
| 91 | + session_file = FIXTURE_PATH / "workspace/builder" / "two_pane.yaml" |
| 92 | + |
| 93 | + # open it detached |
| 94 | + session = load_workspace( |
| 95 | + session_file, |
| 96 | + socket_name=server.socket_name, |
| 97 | + tmux_config_file=FIXTURE_PATH / "tmux" / "tmux.conf", |
| 98 | + detached=True, |
| 99 | + ) |
| 100 | + |
| 101 | + assert isinstance(session, Session) |
| 102 | + assert isinstance(session.server, Server) |
| 103 | + assert session.server.config_file == FIXTURE_PATH / "tmux" / "tmux.conf" |
| 104 | + |
| 105 | + |
83 | 106 | def test_load_workspace_named_session(
|
84 | 107 | server: "Server", monkeypatch: pytest.MonkeyPatch
|
85 | 108 | ) -> None:
|
|
0 commit comments