diff --git a/tests/legacy_api/test_window.py b/tests/legacy_api/test_window.py index 1801c484b..bc34f7148 100644 --- a/tests/legacy_api/test_window.py +++ b/tests/legacy_api/test_window.py @@ -210,7 +210,7 @@ def test_show_window_options(session: Session) -> None: def test_set_window_and_show_window_options(session: Session) -> None: - """Set option then Window.show_window_options(key).""" + """Window.set_window_option() then Window.show_window_options(key).""" window = session.new_window(window_name="test_window") window.set_window_option("main-pane-height", 20) @@ -225,6 +225,22 @@ def test_set_window_and_show_window_options(session: Session) -> None: assert window.show_window_option("pane-border-format") == " #P " +def test_set_and_show_window_options(session: Session) -> None: + """Window.set_option() then Window.show_window_options(key).""" + window = session.new_window(window_name="test_window") + + window.set_option("main-pane-height", 20) + assert window.show_window_option("main-pane-height") == 20 + + window.set_option("main-pane-height", 40) + assert window.show_window_option("main-pane-height") == 40 + assert window.show_window_options()["main-pane-height"] == 40 + + if has_gte_version("2.3"): + window.set_option("pane-border-format", " #P ") + assert window.show_window_option("pane-border-format") == " #P " + + def test_empty_window_option_returns_None(session: Session) -> None: """Verify unset window option returns None.""" window = session.new_window(window_name="test_window") diff --git a/tests/test_window.py b/tests/test_window.py index fff20653d..a51e95fe9 100644 --- a/tests/test_window.py +++ b/tests/test_window.py @@ -237,6 +237,22 @@ def test_set_window_and_show_window_options(session: Session) -> None: assert window.show_window_option("pane-border-format") == " #P " +def test_set_and_show_window_options(session: Session) -> None: + """Window.set_option() then Window.show_window_options(key).""" + window = session.new_window(window_name="test_window") + + window.set_option("main-pane-height", 20) + assert window.show_window_option("main-pane-height") == 20 + + window.set_option("main-pane-height", 40) + assert window.show_window_option("main-pane-height") == 40 + assert window.show_window_options()["main-pane-height"] == 40 + + if has_gte_version("2.3"): + window.set_option("pane-border-format", " #P ") + assert window.show_window_option("pane-border-format") == " #P " + + def test_empty_window_option_returns_None(session: Session) -> None: """Verify unset window option returns None.""" window = session.new_window(window_name="test_window")