diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 993a96c..492bed6 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -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