12
12
13
13
from . import fixtures_dir
14
14
from libtmux import Window
15
+ from libtmux .common import has_gte_version
15
16
from libtmux .test import temp_session
16
17
from tmuxp import config , exc
17
18
from tmuxp ._compat import text_type
@@ -242,6 +243,9 @@ def test_window_options(session):
242
243
sconfig = sconfig .import_config (yaml_config ).get ()
243
244
sconfig = config .expand (sconfig )
244
245
246
+ if has_gte_version ('2.3' ):
247
+ sconfig ['windows' ][0 ]['options' ]['pane-border-format' ] = ' #P '
248
+
245
249
builder = WorkspaceBuilder (sconf = sconfig )
246
250
247
251
window_count = len (session ._windows ) # current window count
@@ -253,6 +257,8 @@ def test_window_options(session):
253
257
assert len (s ._windows ) == window_count
254
258
assert isinstance (w , Window )
255
259
assert w .show_window_option ('main-pane-height' ) == 5
260
+ if has_gte_version ('2.3' ):
261
+ assert w .show_window_option ('pane-border-format' ) == ' #P '
256
262
257
263
assert len (s ._windows ) == window_count
258
264
window_count += 1
@@ -262,7 +268,6 @@ def test_window_options(session):
262
268
@pytest .mark .flaky (reruns = 5 )
263
269
def test_window_options_after (session ):
264
270
yaml_config = loadfixture ("workspacebuilder/window_options_after.yaml" )
265
- s = session
266
271
sconfig = kaptan .Kaptan (handler = 'yaml' )
267
272
sconfig = sconfig .import_config (yaml_config ).get ()
268
273
sconfig = config .expand (sconfig )
@@ -274,8 +279,8 @@ def assert_last_line(p, s):
274
279
correct = False
275
280
for _ in range (10 ):
276
281
pane_out = p .cmd ('capture-pane' , '-p' , '-J' ).stdout
277
- # delete trailing empty lines for tmux 1.8...
278
- while not pane_out [ - 1 ]. strip (): pane_out .pop ()
282
+ while not pane_out [ - 1 ]. strip (): # delete trailing lines tmux 1.8
283
+ pane_out .pop ()
279
284
if len (pane_out ) > 1 and pane_out [- 2 ].strip () == s :
280
285
correct = True
281
286
break
@@ -291,10 +296,11 @@ def assert_last_line(p, s):
291
296
for i , pane in enumerate (session .attached_window .panes ):
292
297
assert assert_last_line (pane , str (i )), \
293
298
"Initial command did not execute properly/" + str (i )
294
- pane .cmd ('send-keys' , 'Up' ) # Will repeat echo
295
- pane .enter () # in each iteration
296
- assert assert_last_line (pane , str (i )), \
297
- "Repeated command did not execute properly/" + str (i )
299
+ pane .cmd ('send-keys' , 'Up' ) # Will repeat echo
300
+ pane .enter () # in each iteration
301
+ assert assert_last_line (pane , str (i )), (
302
+ "Repeated command did not execute properly/" + str (i )
303
+ )
298
304
299
305
session .cmd ('send-keys' , ' echo moo' )
300
306
session .cmd ('send-keys' , 'Enter' )
0 commit comments