Skip to content

Commit

Permalink
Add test for printing help when cli is called with no args
Browse files Browse the repository at this point in the history
modified:   tests/test_cmdline.py
  • Loading branch information
jugmac00 committed Nov 28, 2020
1 parent 805e1b3 commit df82e3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ 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

0 comments on commit df82e3c

Please sign in to comment.