Skip to content

Commit c4d25b8

Browse files
committed
use a buffer name with capture pane test
1 parent 883619a commit c4d25b8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test_workspacebuilder.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def assertIsMissing(cmd, hist):
160160
(inHistoryWindow, 'inHistory', assertHistory,),
161161
(isMissingWindow, 'isMissing', assertIsMissing,)
162162
]:
163+
assert w.name == window_name
163164
correct = False
164165
w.select_window()
165166
p = w.attached_pane
@@ -169,15 +170,19 @@ def assertIsMissing(cmd, hist):
169170
p.cmd('send-keys', ' fc -ln -1')
170171
p.cmd('send-keys', 'Enter')
171172

173+
buffer_name = 'test'
172174
for _ in range(10):
173175
time.sleep(0.1)
174176
# from v0.7.4 libtmux session.cmd adds target -t self.id by default
175177
# show-buffer doesn't accept -t, use global cmd.
176178

177179
# Get the contents of the pane
178-
p.cmd('capture-pane')
179-
captured_pane = session.server.cmd('show-buffer')
180-
session.server.cmd('delete-buffer')
180+
p.cmd('capture-pane', '-b', buffer_name)
181+
182+
captured_pane = session.server.cmd(
183+
'show-buffer', '-b', buffer_name
184+
)
185+
session.server.cmd('delete-buffer', '-b', buffer_name)
181186

182187
# Parse the sent and last-in-history commands
183188
sent_cmd = captured_pane.stdout[0].strip()

0 commit comments

Comments
 (0)