Skip to content

Commit

Permalink
Add test for --no-zle shell option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLocehiliosan committed Dec 29, 2020
1 parent c7a789c commit 0d3ff08
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/test_enter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand All @@ -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
Expand Down

0 comments on commit 0d3ff08

Please sign in to comment.