File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 1010from libtmux import exc
1111from libtmux ._internal .query_list import ObjectDoesNotExist
1212from libtmux .common import has_gte_version , has_lt_version
13- from libtmux .constants import ResizeAdjustmentDirection
13+ from libtmux .constants import ResizeAdjustmentDirection , WindowDirection
1414from libtmux .pane import Pane
1515from libtmux .server import Server
1616from libtmux .session import Session
@@ -510,3 +510,29 @@ def test_resize(
510510 )
511511 window_height_expanded = int (window .window_height )
512512 assert window_height_before < window_height_expanded
513+
514+
515+ @pytest .mark .skipif (
516+ has_gte_version ("3.2" ),
517+ reason = "Only 3.2+ has the -a and -b flag on new-window" ,
518+ )
519+ def test_new_window_with_direction_logs_warning_for_old_tmux (
520+ session : Session ,
521+ caplog : pytest .LogCaptureFixture ,
522+ ) -> None :
523+ """Verify new window with direction create a warning if tmux is too old."""
524+ window = session .active_window
525+ window .refresh ()
526+
527+ window .new_window (
528+ window_name = "window_with_direction" ,
529+ direction = WindowDirection .After ,
530+ )
531+
532+ assert any (
533+ "Window target ignored" in record .msg for record in caplog .records
534+ ), "Warning missing"
535+
536+ assert any (
537+ "Direction flag ignored" in record .msg for record in caplog .records
538+ ), "Warning missing"
You can’t perform that action at this time.
0 commit comments