|
9 | 9 |
|
10 | 10 | from libtmux import exc
|
11 | 11 | from libtmux.common import has_gte_version, has_lt_version, has_version
|
| 12 | +from libtmux.constants import OptionScope |
12 | 13 | from libtmux.pane import Pane
|
13 | 14 | from libtmux.server import Server
|
14 | 15 | from libtmux.session import Session
|
@@ -285,18 +286,37 @@ def test_set_and_show_options(session: Session) -> None:
|
285 | 286 | window = session.new_window(window_name="test_window")
|
286 | 287 |
|
287 | 288 | window.set_option("main-pane-height", 20)
|
288 |
| - assert window._show_option("main-pane-height") == 20 |
| 289 | + if has_gte_version("3.0"): |
| 290 | + assert window._show_option("main-pane-height") == 20 |
| 291 | + else: |
| 292 | + assert window._show_option("main-pane-height", scope=OptionScope.Window) == 20 |
289 | 293 |
|
290 | 294 | window.set_option("main-pane-height", 40)
|
291 |
| - assert window._show_option("main-pane-height") == 40 |
| 295 | + |
| 296 | + if has_gte_version("3.0"): |
| 297 | + assert window._show_option("main-pane-height") == 40 |
| 298 | + else: |
| 299 | + assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40 |
292 | 300 |
|
293 | 301 | # By default, show-options will session scope, even if target is a window
|
294 | 302 | with pytest.raises(KeyError):
|
295 | 303 | assert window._show_options()["main-pane-height"] == 40
|
296 | 304 |
|
| 305 | + if has_gte_version("3.0"): |
| 306 | + assert window._show_option("main-pane-height") == 40 |
| 307 | + else: |
| 308 | + assert window._show_option("main-pane-height", scope=OptionScope.Window) == 40 |
| 309 | + |
297 | 310 | if has_gte_version("2.3"):
|
298 | 311 | window.set_option("pane-border-format", " #P ")
|
299 |
| - assert window._show_option("pane-border-format") == " #P " |
| 312 | + |
| 313 | + if has_gte_version("3.0"): |
| 314 | + assert window._show_option("pane-border-format") == " #P " |
| 315 | + else: |
| 316 | + assert ( |
| 317 | + window._show_option("pane-border-format", scope=OptionScope.Window) |
| 318 | + == " #P " |
| 319 | + ) |
300 | 320 |
|
301 | 321 |
|
302 | 322 | def test_empty_window_option_returns_None(session: Session) -> None:
|
|
0 commit comments