Skip to content

Commit c49495b

Browse files
committed
tests(Window): show_options w/ scope
1 parent a837d56 commit c49495b

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

tests/legacy_api/test_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_fresh_window_data(session: Session) -> None:
5252
"""Verify window data is fresh."""
5353
attached_window = session.attached_window
5454
assert attached_window is not None
55-
pane_base_idx = attached_window.show_option("pane-base-index", _global=True)
55+
pane_base_idx = attached_window.show_option("pane-base-index", global_=True)
5656
assert pane_base_idx is not None
5757
pane_base_index = int(pane_base_idx)
5858

tests/test_window.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from libtmux._internal.query_list import ObjectDoesNotExist
1515
from libtmux.common import has_gte_version, has_lt_version, has_lte_version
1616
from libtmux.constants import (
17+
OptionScope,
1718
PaneDirection,
1819
ResizeAdjustmentDirection,
1920
WindowDirection,
@@ -60,7 +61,7 @@ def test_fresh_window_data(session: Session) -> None:
6061
"""Verify window data is fresh."""
6162
active_window = session.active_window
6263
assert active_window is not None
63-
pane_base_idx = active_window.show_option("pane-base-index", _global=True)
64+
pane_base_idx = active_window.show_option("pane-base-index", global_=True)
6465
assert pane_base_idx is not None
6566
pane_base_index = int(pane_base_idx)
6667

@@ -285,6 +286,27 @@ def test_show_window_options(session: Session) -> None:
285286
options = window.show_window_options()
286287
assert isinstance(options, dict)
287288

289+
options_2 = window.show_options()
290+
assert isinstance(options_2, dict)
291+
292+
pane_options = window.show_options(scope=OptionScope.Pane)
293+
assert isinstance(pane_options, dict)
294+
295+
pane_options_global = window.show_options(scope=OptionScope.Pane, global_=True)
296+
assert isinstance(pane_options_global, dict)
297+
298+
window_options = window.show_options(scope=OptionScope.Window)
299+
assert isinstance(window_options, dict)
300+
301+
window_options_global = window.show_options(scope=OptionScope.Window, global_=True)
302+
assert isinstance(window_options_global, dict)
303+
304+
server_options = window.show_options(scope=OptionScope.Server)
305+
assert isinstance(server_options, dict)
306+
307+
server_options_global = window.show_options(scope=OptionScope.Server, global_=True)
308+
assert isinstance(server_options_global, dict)
309+
288310

289311
def test_set_window_and_show_window_options(session: Session) -> None:
290312
"""Window.set_window_option() then Window.show_window_options(key)."""

0 commit comments

Comments
 (0)