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

Add print_version test.

parent 73489e3b
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ from io import StringIO
from diceware import (
SRC_DIR, RE_LANG_CODE, SPECIAL_CHARS, get_wordlist,
get_wordlist_path, insert_special_char, get_passphrase,
handle_options, main, __version__,
handle_options, main, __version__, print_version,
)
......@@ -144,6 +144,13 @@ class TestDicewareModule(object):
phrase = get_passphrase(capitalized=False)
assert phrase.lower() == phrase
def test_print_version(self, capsys):
# we can print version infos
print_version()
out, err = capsys.readouterr()
assert err == ''
assert __version__ in out
def test_handle_options(self):
# we can get help
with pytest.raises(SystemExit) as exc_info:
......
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