Skip to content

Commit

Permalink
Merge pull request #93 from koodaamo/test-help-text
Browse files Browse the repository at this point in the history
Add tests for cmdline.py
  • Loading branch information
petri authored Nov 28, 2020
2 parents 77f327d + e1cba1c commit 25894f9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,20 @@ def test_handle_value_errors(mocked_TNEF):
with pytest.raises(SystemExit):
from tnefparse.cmdline import tnefparse
tnefparse()


def test_help_is_printed(script_runner):
"""calling `tnefparse` with no argument prints help text"""
ret = script_runner.run('tnefparse')
help_text = "Extract TNEF file contents. Show this help message if no arguments are given."
assert help_text in ret.stdout
assert "positional arguments" in ret.stdout
assert "optional argument" in ret.stdout


def test_print_overview(script_runner):
ret = script_runner.run('tnefparse', '-o', 'tests/examples/one-file.tnef')
assert "Overview of tests/examples/one-file.tnef" in ret.stdout
assert "Attachments" in ret.stdout
assert "Objects" in ret.stdout
assert "Properties" in ret.stdout

0 comments on commit 25894f9

Please sign in to comment.