17
17
18
18
19
19
def test_select_window (session : Session ) -> None :
20
+ """Test Window.select_window()."""
20
21
window_count = len (session ._windows )
21
22
# to do, get option for base-index from tmux
22
23
# for now however, let's get the index from the first window.
@@ -42,7 +43,8 @@ def test_select_window(session: Session) -> None:
42
43
assert len (session ._windows ) == 2
43
44
44
45
45
- def test_zfresh_window_data (session : Session ) -> None :
46
+ def test_fresh_window_data (session : Session ) -> None :
47
+ """Verify window data is fresh."""
46
48
attached_window = session .attached_window
47
49
assert attached_window is not None
48
50
pane_base_idx = attached_window .show_window_option ("pane-base-index" , g = True )
@@ -95,6 +97,7 @@ def test_zfresh_window_data(session: Session) -> None:
95
97
96
98
97
99
def test_newest_pane_data (session : Session ) -> None :
100
+ """Test window.panes has fresh data."""
98
101
window = session .new_window (window_name = "test" , attach = True )
99
102
assert isinstance (window , Window )
100
103
assert len (window .panes ) == 1
@@ -161,7 +164,7 @@ def test_split_window_horizontal(session: Session) -> None:
161
164
def test_window_rename (
162
165
session : Session , window_name_before : str , window_name_after : str
163
166
) -> None :
164
- """Window.rename_window()."""
167
+ """Test Window.rename_window()."""
165
168
window_name_before = "test"
166
169
window_name_after = "ha ha ha fjewlkjflwef"
167
170
@@ -183,6 +186,7 @@ def test_window_rename(
183
186
184
187
185
188
def test_kill_window (session : Session ) -> None :
189
+ """Test window.kill_window() kills window."""
186
190
session .new_window ()
187
191
# create a second window to not kick out the client.
188
192
# there is another way to do this via options too.
@@ -222,6 +226,7 @@ def test_set_show_window_options(session: Session) -> None:
222
226
223
227
224
228
def test_empty_window_option_returns_None (session : Session ) -> None :
229
+ """Verify unset window option returns None."""
225
230
window = session .new_window (window_name = "test_window" )
226
231
assert window .show_window_option ("alternate-screen" ) is None
227
232
@@ -287,6 +292,7 @@ def test_move_window(session: Session) -> None:
287
292
288
293
289
294
def test_move_window_to_other_session (server : Server , session : Session ) -> None :
295
+ """Window.move_window to other session."""
290
296
window = session .new_window (window_name = "test_window" )
291
297
new_session = server .new_session ("test_move_window" )
292
298
window .move_window (session = new_session .get ("session_id" ))
@@ -305,6 +311,7 @@ def test_select_layout_accepts_no_arg(server: Server, session: Session) -> None:
305
311
has_lt_version ("3.2" ), reason = "needs filter introduced in tmux >= 3.2"
306
312
)
307
313
def test_empty_window_name (session : Session ) -> None :
314
+ """New windows can be created with empty string for window name."""
308
315
session .set_option ("automatic-rename" , "off" )
309
316
window = session .new_window (window_name = "''" , attach = True )
310
317
@@ -337,6 +344,7 @@ def test_split_window_with_environment(
337
344
session : Session ,
338
345
environment : t .Dict [str , str ],
339
346
) -> None :
347
+ """Verify splitting window with environment variables."""
340
348
env = shutil .which ("env" )
341
349
assert env is not None , "Cannot find usable `env` in Path."
342
350
@@ -361,6 +369,7 @@ def test_split_window_with_environment_logs_warning_for_old_tmux(
361
369
session : Session ,
362
370
caplog : pytest .LogCaptureFixture ,
363
371
) -> None :
372
+ """Verify splitting window with environment variables warns if tmux too old."""
364
373
env = shutil .which ("env" )
365
374
assert env is not None , "Cannot find usable `env` in Path."
366
375
0 commit comments