add test for longargument property

This commit is contained in:
Emmanuel Garette 2019-04-03 07:55:19 +02:00 committed by Emmanuel Garette
parent 132d57a4c6
commit cb41e731ea

View file

@ -597,3 +597,15 @@ def test_readme_list_uniq_tree_flatten():
parser = TiramisuCmdlineParser(config, 'prog.py', fullpath=False) parser = TiramisuCmdlineParser(config, 'prog.py', fullpath=False)
parser.parse_args(['list', '--list', 'a']) parser.parse_args(['list', '--list', 'a'])
assert config.value.dict() == output assert config.value.dict() == output
def test_readme_longargument():
output = {'cmd': 'list',
'list': ['a'],
'verbosity': True,
'v': True}
config = get_config()
config.option('verbosity').property.add('longargument')
parser = TiramisuCmdlineParser(config, 'prog.py')
parser.parse_args(['list', '--list', 'a', '--v'])
assert config.value.dict() == output