Add test for --no-zle shell option

This commit is contained in:
Tim Byrne 2020-12-29 17:58:51 -06:00
parent c7a789c871
commit 0d3ff086c5
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 9 additions and 1 deletions

View File

@ -63,8 +63,12 @@ def test_enter(runner, yadm_cmd, paths, shell, success):
'cmd',
[False, 'cmd', 'cmd-bad-exit'],
ids=['no-cmd', 'cmd', 'cmd-bad-exit'])
@pytest.mark.parametrize(
'term', ['', 'dumb'],
ids=['term-empty', 'term-dumb'])
@pytest.mark.usefixtures('ds1_copy')
def test_enter_shell_ops(runner, yadm_cmd, paths, shell, opts, path, cmd):
def test_enter_shell_ops(runner, yadm_cmd, paths, shell,
opts, path, cmd, term):
"""Enter tests for specific shell options"""
change_exit = '\nfalse' if cmd == 'cmd-bad-exit' else ''
@ -83,8 +87,12 @@ def test_enter_shell_ops(runner, yadm_cmd, paths, shell, opts, path, cmd):
enter_cmd += test_cmd
env = os.environ.copy()
env['TERM'] = term
env['SHELL'] = custom_shell
if shell == 'zsh' and term == 'dumb':
opts += ' --no-zle'
run = runner(command=yadm_cmd(*enter_cmd), env=env)
if cmd == 'cmd-bad-exit':
assert run.failure