diff --git a/tests/test_diceware.py b/tests/test_diceware.py index 9946827cd0bc522a563386153255869dd0a43407..bbfa953730f13265b94e949903a931bc5f8c878c 100644 --- a/tests/test_diceware.py +++ b/tests/test_diceware.py @@ -79,6 +79,15 @@ class TestDicewareModule(object): options = handle_options([]) assert options.num == 6 + def test_main(self, capsys): + # we can get a passphrase + main([]) # call with default options in place + out, err = capsys.readouterr() + assert err == '' # we got no errors + assert out[-1] == '\n' # output ends with liebreak + assert not ('\n' in out[:-1]) # we get one line + assert len(out) > 5 # we get at least some chars + def test_main_help(self, capsys): # we can get help with pytest.raises(SystemExit) as exc_info: @@ -96,12 +105,3 @@ class TestDicewareModule(object): ' -h, --help show this help message and exit\n' ' -n NUM, --num NUM number of words to concatenate. Default: 6\n' ) - - def test_main(self, capsys): - # we can get a passphrase - main([]) # call with default options in place - out, err = capsys.readouterr() - assert err == '' # we got no errors - assert out[-1] == '\n' # output ends with liebreak - assert not ('\n' in out[:-1]) # we get one line - assert len(out) > 5 # we get at least some chars