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

Add missing test for configfile integration.

Make sure that config file values are really considered by
handle_options().
parent 64a5f2fb
No related branches found
No related tags found
No related merge requests found
......@@ -192,6 +192,20 @@ class TestDicewareModule(object):
assert out == ''
assert "invalid choice" in err
def test_handle_options_considers_configfile(self, home_dir):
# defaults from a local configfile are respected
config_file = home_dir / ".diceware.ini"
config_file.write("\n".join(
["[diceware]",
"num = 3",
"caps = off",
"delimiter = my-delim",
""]))
options = handle_options([])
assert options.num == 3
assert options.delimiter == "my-delim"
assert options.caps is False
def test_main(self, capsys):
# we can get a passphrase
main([]) # call with default options in place
......
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