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

Undo changes to "considers_configfile" tests.

The modifications undone here, in
`test_handle_options_considers_configfile()` could have gone into an
own test. Each single test should only test a clear minimum of
things.

This specific test checked, whether configiles are considered at
all. It was not its purpose to examine correct interpretation of
keywords in the .ini-file; only to see whether these keyword values
can be changed at all.

If we wanted a complete and strict checking also of values, we had at
least to check all possible keywords, including 'randomsource' and
'wordlist'. Instead we only check a boolean, int, and string type
keyword.

Therefore the change to `test_handle_options_considers_configfile()`
should have gone to another test.

But then, the added testing is not neccessary. We had a test already
that should have checked the 'caps' value properly. This test was done
wrong before and is now done correctly, thanks to @dwcoder .

I therefore removed the added test functionality.
parent dd1f56af
No related branches found
No related tags found
No related merge requests found
......@@ -194,7 +194,7 @@ class TestDicewareModule(object):
assert out == ''
assert "invalid choice" in err
def test_handle_options_considers_configfile(self, home_dir, capsys):
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(
......@@ -207,12 +207,6 @@ class TestDicewareModule(object):
assert options.num == 3
assert options.delimiter == "my-delim"
assert options.caps is False
# Now test the main program
sys.stdin = StringIO("word1\n")
sys.argv = ['diceware', '-']
main() # call with default options in place
out, err = capsys.readouterr()
assert out == 'word1my-delimword1my-delimword1\n'
def test_main(self, capsys):
# we can get a passphrase
......
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