-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[detype1] Fix exit code for known options (#536)
Partial fix for #347
- Loading branch information
1 parent
4b5e3b6
commit 9627a82
Showing
4 changed files
with
45 additions
and
5 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
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
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
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 |
---|---|---|
@@ -1,13 +1,28 @@ | ||
from __future__ import print_function, division, absolute_import | ||
|
||
import platform | ||
import pytest | ||
import subprocess32 as subprocess | ||
|
||
from .runner import main as runner | ||
from .runner import _check_tool | ||
|
||
|
||
def test_bad_tx_cmd(): | ||
# Trigger a fatal error from a command line tool, to make sure | ||
# it is handled correctly. | ||
with pytest.raises(subprocess.CalledProcessError): | ||
runner(['-t', 'tx', '-n', '-o', 'bad_opt']) | ||
|
||
|
||
@pytest.mark.parametrize('tool_name', ['not_a_tool']) | ||
def test_check_tool_error(tool_name): | ||
assert isinstance(_check_tool(tool_name), tuple) | ||
|
||
|
||
@pytest.mark.parametrize('tool_name', ['detype1']) | ||
def test_check_tool_unhacked(tool_name): | ||
expected_name = tool_name | ||
if platform.system() == 'Windows': | ||
expected_name += '.exe' | ||
assert _check_tool(tool_name) == expected_name |