diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/fs.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1219,11 +1219,18 @@ def test(binary, quic=False): assert client.read('/index') == before assert client.read('/pane/1/body') == b'initial\n' + # A session that answers takes the file or says why, as acme's B + # does: a pane it has not is its refusal and exit 1, never a + # nested editor drawn inside the pane that asked. + gone = subprocess.run([binary, '--tty', str(spaced)], cwd=root, + env=dict(env, PARDES_PANE='4294967295'), stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10) + assert gone.returncode == 1 and gone.stderr.startswith(b'pardes: '), gone + assert client.read('/index') == before for name, identity, word in [ ('stale-file', dict(inherited, PARDES_9P=str(root / 'absent.sock')), str(spaced)), ('stale-missing', dict(inherited, PARDES_9P=str(root / 'absent.sock')), 'missing-child-file.txt'), ('stale-noarg', dict(inherited, PARDES_9P=str(root / 'absent.sock')), None), - ('stale-pane', dict(inherited, PARDES_PANE='4294967295'), str(spaced)), # No pid means "not inside a pardes at all", which is what # --nested withholds and what a plain shell has. ('not-nested', {k: v for k, v in inherited.items() if k != 'PARDES_PID'}, str(spaced)), @@ -1310,6 +1317,14 @@ def test(binary, quic=False): execute(client, named, 'Save') client.remove(f'/pane/{named}') assert deep.read_bytes() == b'deep\n' + # A name the session refuses: its reason and exit 1, as B's, + # never a nested editor, and no pane left for it. + before = serials() + refused = subprocess.run([binary, 'bad\x01name.txt'], cwd=root, env=env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10) + assert refused.returncode == 1, refused + assert b'bad character in file name' in refused.stderr, refused.stderr + assert serials() == before, (serials(), before) orphan = launch('--wait') assert orphan.poll() is None assert orphan.wait(timeout=5) == 1 |
