Skip to content

Commit fdd66d6

Browse files
committed
tests(workspace[config]): Note pydocstyle updates
1 parent 7f015bf commit fdd66d6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/workspace/test_config.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616

1717
def load_workspace(path: t.Union[str, pathlib.Path]) -> t.Dict[str, t.Any]:
18+
"""Load tmuxp workspace configuration from file."""
1819
return ConfigReader._from_file(
1920
pathlib.Path(path) if isinstance(path, str) else path
2021
)
@@ -23,6 +24,7 @@ def load_workspace(path: t.Union[str, pathlib.Path]) -> t.Dict[str, t.Any]:
2324
def test_export_json(
2425
tmp_path: pathlib.Path, config_fixture: "WorkspaceTestData"
2526
) -> None:
27+
"""Test exporting configuration dictionary to JSON."""
2628
json_workspace_file = tmp_path / "config.json"
2729

2830
configparser = ConfigReader(config_fixture.sample_workspace.sample_workspace_dict)
@@ -94,6 +96,7 @@ def test_workspace_expand2(config_fixture: "WorkspaceTestData") -> None:
9496

9597

9698
def test_inheritance_workspace() -> None:
99+
"""TODO: Create a test to verify workspace config inheritance to object tree."""
97100
workspace = inheritance_workspace_before
98101

99102
# TODO: Look at verifying window_start_directory
@@ -133,6 +136,7 @@ def test_shell_command_before(config_fixture: "WorkspaceTestData") -> None:
133136

134137

135138
def test_in_session_scope(config_fixture: "WorkspaceTestData") -> None:
139+
"""Verify shell_command before_session is in session scope."""
136140
sconfig = ConfigReader._load(
137141
format="yaml", content=config_fixture.shell_command_before_session.before
138142
)
@@ -146,11 +150,13 @@ def test_in_session_scope(config_fixture: "WorkspaceTestData") -> None:
146150

147151

148152
def test_trickle_relative_start_directory(config_fixture: "WorkspaceTestData") -> None:
153+
"""Verify tmuxp config proliferates relative start directory to descendants."""
149154
test_workspace = loader.trickle(config_fixture.trickle.before)
150155
assert test_workspace == config_fixture.trickle.expected
151156

152157

153158
def test_trickle_window_with_no_pane_workspace() -> None:
159+
"""Verify tmuxp window config automatically infers a single pane."""
154160
test_yaml = """
155161
session_name: test_session
156162
windows:
@@ -201,6 +207,7 @@ def test_expands_blank_panes(config_fixture: "WorkspaceTestData") -> None:
201207

202208

203209
def test_no_session_name() -> None:
210+
"""Verify exception raised when tmuxp configuration has no session name."""
204211
yaml_workspace = """
205212
- window_name: editor
206213
panes:
@@ -222,6 +229,7 @@ def test_no_session_name() -> None:
222229

223230

224231
def test_no_windows() -> None:
232+
"""Verify exception raised when tmuxp configuration has no windows."""
225233
yaml_workspace = """
226234
session_name: test session
227235
"""
@@ -234,6 +242,7 @@ def test_no_windows() -> None:
234242

235243

236244
def test_no_window_name() -> None:
245+
"""Verify exception raised when tmuxp config missing window name."""
237246
yaml_workspace = """
238247
session_name: test session
239248
windows:
@@ -256,6 +265,7 @@ def test_no_window_name() -> None:
256265

257266

258267
def test_replaces_env_variables(monkeypatch: pytest.MonkeyPatch) -> None:
268+
"""Test loading configuration resolves environmental variables."""
259269
env_key = "TESTHEY92"
260270
env_val = "HEYO1"
261271
yaml_workspace = """
@@ -296,7 +306,8 @@ def test_replaces_env_variables(monkeypatch: pytest.MonkeyPatch) -> None:
296306
assert "logging @ %s" % env_val == sconfig["windows"][1]["window_name"]
297307

298308

299-
def test_plugins() -> None:
309+
def test_validate_plugins() -> None:
310+
"""Test validation of plugins loading via tmuxp configuration file."""
300311
yaml_workspace = """
301312
session_name: test session
302313
plugins: tmuxp-plugin-one.plugin.TestPluginOne

0 commit comments

Comments
 (0)