1
0
Fork 0
mirror of synced 2024-11-16 22:35:35 -05:00

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

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