summaryrefslogtreecommitdiff
path: root/test/daemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/daemon.py')
-rw-r--r--test/daemon.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/daemon.py b/test/daemon.py
index bf575fd7..2c2ee318 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -1288,16 +1288,20 @@ def gui(binary, cycles):
assert not sized(client), 'the first window stays'
assert proc.poll() is None
print('daemon: a second window on an attached window session, detached alone')
- # Another kind is refused in words, and so is a name nobody has.
+ # Another kind joins as a replica client: a terminal of the window's
+ # session, by its name alone. A name nobody has is refused in words.
client.write(f'/pane/{shell}/exec', b'Detach\n')
wait_for('the window closed', lambda: sized(client))
term = Term()
tty_attach = term.spawn([binary.replace('pardes-gui', 'pardes'), '--attach=win'], env)
- assert tty_attach.wait(timeout=10) == 1
- wait_for('the refusal in the terminal', lambda: b'is a window' in term.text())
- said = term.text()
+ wait_for('the window session drawn in the terminal', lambda: b'\x1b[?1049h' in term.text())
+ time.sleep(1)
+ assert tty_attach.poll() is None, term.text()[-400:]
+ tty_attach.terminate()
+ tty_attach.wait(timeout=10)
term.close()
- assert b'is a window' in said, said
+ assert proc.poll() is None
+ print('daemon: a terminal attached to a window session by name, as a client')
nobody = subprocess.run([binary, '--attach=nobody'], env=env, cwd=root, timeout=10,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert nobody.returncode == 1 and b"no session called 'nobody'" in nobody.stderr, nobody.stderr