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