Test default provided options are forwarded

Ensure options provided external to the command-line (i.e.,
configuration files) are present in the final result of options.
This commit is contained in:
Eric N. Vander Weele 2019-08-30 15:17:16 -04:00
parent ec8fcfc8f8
commit b231c10016

View file

@ -22,6 +22,13 @@ def test_option_manager_creates_option_parser(optmanager):
assert isinstance(optmanager.parser, argparse.ArgumentParser)
def test_parse_args_forwarding_default_values(optmanager):
"""Verify default provided values are present in the final result."""
namespace = argparse.Namespace(foo='bar')
options, args = optmanager.parse_args([], namespace)
assert options.foo == 'bar'
def test_add_option_short_option_only(optmanager):
"""Verify the behaviour of adding a short-option only."""
assert optmanager.options == []