Add test for --no-zle shell option
This commit is contained in:
parent
c7a789c871
commit
0d3ff086c5
1 changed files with 9 additions and 1 deletions
|
@ -63,8 +63,12 @@ def test_enter(runner, yadm_cmd, paths, shell, success):
|
||||||
'cmd',
|
'cmd',
|
||||||
[False, 'cmd', 'cmd-bad-exit'],
|
[False, 'cmd', 'cmd-bad-exit'],
|
||||||
ids=['no-cmd', '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')
|
@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"""
|
"""Enter tests for specific shell options"""
|
||||||
|
|
||||||
change_exit = '\nfalse' if cmd == 'cmd-bad-exit' else ''
|
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
|
enter_cmd += test_cmd
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
|
env['TERM'] = term
|
||||||
env['SHELL'] = custom_shell
|
env['SHELL'] = custom_shell
|
||||||
|
|
||||||
|
if shell == 'zsh' and term == 'dumb':
|
||||||
|
opts += ' --no-zle'
|
||||||
|
|
||||||
run = runner(command=yadm_cmd(*enter_cmd), env=env)
|
run = runner(command=yadm_cmd(*enter_cmd), env=env)
|
||||||
if cmd == 'cmd-bad-exit':
|
if cmd == 'cmd-bad-exit':
|
||||||
assert run.failure
|
assert run.failure
|
||||||
|
|
Loading…
Reference in a new issue