Skip to content

Commit

Permalink
a new test
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Aug 13, 2024
1 parent 079d073 commit 3529a80
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/test_proxy_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from emptylog import MemoryLogger

import suby
from suby import RunningCommandError
from suby import RunningCommandError, WrongCommandError


@pytest.mark.parametrize(
Expand Down Expand Up @@ -515,3 +515,16 @@ def test_multiple_args_without_split(command):
assert result.stdout == 'kek\n'
assert result.stderr == ''
assert result.returncode == 0


@pytest.mark.parametrize(
['command', 'exception_message'],
[
((Path(sys.executable), '-c "'), 'The expression "-c "" cannot be parsed.'),
((sys.executable, '-c "'), 'The expression "-c "" cannot be parsed.'),
(('python -c "',), 'The expression "python -c "" cannot be parsed.'),
]
)
def test_wrong_command(command, exception_message):
with pytest.raises(WrongCommandError, match=full_match(exception_message)):
suby(*command)

0 comments on commit 3529a80

Please sign in to comment.