Skip to content

Commit 12bd6c3

Browse files
committed
Testsuite: add a time.sleep(.2) in checking pane_current_path, use TEST_SESSION_PREFIX as default prefix in get_test_session_name/window_name.
1 parent 566e072 commit 12bd6c3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tmuxp/testsuite/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
TEST_SESSION_PREFIX = 'test tmuxp_'
2424

2525

26-
def get_test_session_name(server, prefix='tmuxp_'):
26+
def get_test_session_name(server, prefix=TEST_SESSION_PREFIX):
2727
while True:
2828
session_name = prefix + str(randint(0, 9999999))
2929
if not t.has_session(session_name):
3030
break
3131
return session_name
3232

3333

34-
def get_test_window_name(session, prefix='tmuxp_'):
34+
def get_test_window_name(session, prefix=TEST_SESSION_PREFIX):
3535
while True:
3636
window_name = prefix + str(randint(0, 9999999))
3737
if not session.findWhere(window_name=window_name):

tmuxp/testsuite/workspacebuilder.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,12 @@ def test_start_directory(self):
445445
dirs = ['/usr/bin', '/dev', '/tmp/foo bar', '/usr', os.getcwd()]
446446
for path, window in zip(dirs, self.session.windows):
447447
for p in window.panes:
448+
for i in range(60):
449+
p.server._update_panes()
450+
if p.get('pane_current_path') == path:
451+
break
452+
time.sleep(.2)
453+
448454
self.assertEqual(p.get('pane_current_path'), path)
449455

450456

0 commit comments

Comments
 (0)