Skip to content

Commit

Permalink
!squash test_options: renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed May 5, 2024
1 parent 5ebd6bb commit 1fe6c79
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_options.py
Expand Up @@ -334,7 +334,7 @@ class OptionDataclassTestFixture(t.NamedTuple):
test_id: str

# test data
option_data: t.List[str] # option data (raw)
mocked_cmd_stdout: t.List[str] # option data (raw)
tmux_option: str # e.g. terminal-features

# results
Expand All @@ -345,7 +345,7 @@ class OptionDataclassTestFixture(t.NamedTuple):
TEST_FIXTURES: t.List[OptionDataclassTestFixture] = [
OptionDataclassTestFixture(
test_id="terminal-features",
option_data=textwrap.dedent(
mocked_cmd_stdout=textwrap.dedent(
"""
terminal-features[0] xterm*:clipboard:ccolour:cstyle:focus
terminal-features[1] screen*:title
Expand All @@ -362,7 +362,7 @@ class OptionDataclassTestFixture(t.NamedTuple):
),
OptionDataclassTestFixture(
test_id="command-alias",
option_data=textwrap.dedent(
mocked_cmd_stdout=textwrap.dedent(
"""
command-alias[0] split-pane=split-window
command-alias[1] splitp=split-window
Expand Down Expand Up @@ -395,17 +395,17 @@ class OptionDataclassTestFixture(t.NamedTuple):
TEST_FIXTURES,
ids=[test.test_id for test in TEST_FIXTURES],
)
def test_option_dataclass_fixture(
def test_mocked_cmd_stdoutclass_fixture(
monkeypatch: pytest.MonkeyPatch,
test_id: str,
option_data: t.List[str],
mocked_cmd_stdout: t.List[str],
tmux_option: str,
expected: t.Any,
dataclass_attribute: str,
server: "Server",
) -> None:
"""Parametrized test grid for options."""
monkeypatch.setattr(server, "cmd", fake_cmd(stdout=option_data))
monkeypatch.setattr(server, "cmd", fake_cmd(stdout=mocked_cmd_stdout))

_options = server._show_options()
assert any(tmux_option in k for k in _options)
Expand All @@ -423,7 +423,7 @@ def test_option_dataclass_fixture(
def test_show_option_pane_fixture(
monkeypatch: pytest.MonkeyPatch,
test_id: str,
option_data: t.List[str],
mocked_cmd_stdout: t.List[str],
tmux_option: str,
expected: t.Any,
dataclass_attribute: str,
Expand All @@ -434,7 +434,7 @@ def test_show_option_pane_fixture(
window = session.new_window(window_name="test")
pane = window.split_window(attach=False)

monkeypatch.setattr(pane, "cmd", fake_cmd(stdout=option_data))
monkeypatch.setattr(pane, "cmd", fake_cmd(stdout=mocked_cmd_stdout))

result = pane.show_option(tmux_option)

Expand Down

0 comments on commit 1fe6c79

Please sign in to comment.