-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #557 from fomars/master
hotfix ShellExec
- Loading branch information
Showing
2 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
yandextank/plugins/ShellExec/tests/test_shellexec_plugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
from yandextank.plugins.ShellExec import Plugin | ||
|
||
|
||
def test_plugin_execute(): | ||
plugin = Plugin(None, {}, None) | ||
assert plugin.execute('echo foo') == 0 | ||
|
||
|
||
def test_plugin_execute_raises(): | ||
plugin = Plugin(None, {}, None) | ||
with pytest.raises(RuntimeError) as error: | ||
plugin.execute('echo "foo') | ||
assert 'Subprocess returned 2' in error.message |