diff --git a/tests/test_diceware.py b/tests/test_diceware.py index 7217591a3796d0602b40d24d7bb8dd3a5639c2b5..50f16e750ad5a42ccfb9506100b12baa69a50a37 100644 --- a/tests/test_diceware.py +++ b/tests/test_diceware.py @@ -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: