-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Suszyński Krzysztof
committed
Jun 6, 2018
1 parent
380cdc4
commit 8e039d4
Showing
4 changed files
with
25 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
from puppeter.main import main | ||
main() | ||
|
||
if __name__ == '__main__': | ||
main() |
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,3 +1,4 @@ | ||
# the inclusion of the tests module is not meant to offer best practices for | ||
# testing in general, but rather to support the `find_packages` example in | ||
# setup.py that excludes installing the "tests" package | ||
|
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,21 @@ | ||
import re | ||
|
||
import pytest | ||
|
||
from tests.helpers.commandline import captured_output | ||
|
||
|
||
def test_usage_printout(): | ||
from puppeter import __main__ | ||
|
||
with pytest.raises(SystemExit) as sysexit: | ||
with captured_output() as (out, err): | ||
__main__.main(['puppeter', '--help']) | ||
|
||
stdout = out.getvalue().strip() | ||
stderr = err.getvalue().strip() | ||
assert sysexit.value.code == 0 | ||
assert stdout == '' | ||
assert re.compile('Puppeter', re.MULTILINE).search(stderr) | ||
assert re.compile('--answers FILE, -a FILE', re.MULTILINE).search(stderr) | ||
assert re.compile('--execute, -e', re.MULTILINE).search(stderr) |