Make the no-integration test more comprehensive and stronger

This commit is contained in:
Kovid Goyal 2022-03-06 12:23:11 +05:30
parent 85c6d8f16e
commit 4552a474b7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -196,8 +196,14 @@ copy --exclude */w.* d1
# check that turning off shell integration works
if ok_login_shell in ('bash', 'zsh'):
for val in ('', 'no-rc', 'enabled no-rc'):
with tempfile.TemporaryDirectory() as tdir:
self.check_bootstrap('sh', tdir, ok_login_shell, val)
for sh in self.all_possible_sh:
with tempfile.TemporaryDirectory() as tdir:
pty = self.check_bootstrap(sh, tdir, ok_login_shell, val)
num_lines = len(pty.screen_contents().splitlines())
pty.send_cmd_to_child('echo "$TERM=fruity"')
pty.wait_till(lambda: 'kitty=fruity' in pty.screen_contents())
pty.wait_till(lambda: len(pty.screen_contents().splitlines()) >= num_lines + 2)
self.assertEqual(pty.screen.cursor.shape, 0)
def check_bootstrap(self, sh, home_dir, login_shell='', SHELL_INTEGRATION_VALUE='enabled', extra_exec='', pre_data='', ssh_opts=None):
ssh_opts = ssh_opts or {}