Skip to content
Snippets Groups Projects
Commit dc7a6124 authored by ulif's avatar ulif
Browse files

Use text file for output comparison.

parent 2aa1ef42
No related branches found
Tags v0.2
No related merge requests found
...@@ -183,22 +183,11 @@ class TestDicewareModule(object): ...@@ -183,22 +183,11 @@ class TestDicewareModule(object):
main() main()
assert exc_info.value.code == 0 assert exc_info.value.code == 0
out, err = capsys.readouterr() out, err = capsys.readouterr()
assert out == ( expected_path = os.path.join(
'usage: diceware [-h] [-n NUM] [-c | --no-caps] [-s NUM] [INFILE]\n' os.path.dirname(__file__), 'exp_help_output.txt')
'\n' with open(expected_path, 'r') as fd:
'Create a passphrase\n' expected_output = fd.read()
'\n' assert out == expected_output
'positional arguments:\n'
" INFILE Input wordlist. `-' will read from stdin.\n"
'\n'
'optional arguments:\n'
' -h, --help show this help message and exit\n'
' -n NUM, --num NUM number of words to concatenate. Default: 6\n'
' -c, --caps Capitalize words. This is the default.\n'
' --no-caps Turn off capitalization.\n'
' -s NUM, --specials NUM\n'
' Insert NUM special chars into generated word.\n'
)
def test_main_argv(self, argv_handler): def test_main_argv(self, argv_handler):
# main() handles sys.argv if nothing is provided # main() handles sys.argv if nothing is provided
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment