mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 18:46:52 +00:00
Add test for custom arguments to add_option
This commit is contained in:
parent
5a6656d78d
commit
09bc9e2720
1 changed files with 13 additions and 0 deletions
|
|
@ -44,3 +44,16 @@ def test_add_short_and_long_option_names(optmanager):
|
|||
optmanager.add_option('-b', '--both', help='Test both opts')
|
||||
assert optmanager.options[0].short_option_name == '-b'
|
||||
assert optmanager.options[0].long_option_name == '--both'
|
||||
|
||||
|
||||
def test_add_option_with_custom_args(optmanager):
|
||||
assert optmanager.options == []
|
||||
assert optmanager.config_options_dict == {}
|
||||
|
||||
optmanager.add_option('--parse', parse_from_config=True)
|
||||
optmanager.add_option('--commas', comma_separated_list=True)
|
||||
optmanager.add_option('--files', normalize_paths=True)
|
||||
|
||||
attrs = ['parse_from_config', 'comma_separated_list', 'normalize_paths']
|
||||
for option, attr in zip(optmanager.options, attrs):
|
||||
assert getattr(option, attr) is True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue