diff options
author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2008-09-19 09:34:26 +0200 |
---|---|---|
committer | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2008-09-19 09:34:26 +0200 |
commit | 0370f99786e1bc6665c3866c521760cc1bd73067 (patch) | |
tree | 9efe2fe46a81003fd5024d487e6dc695548c8c43 /test | |
parent | 4d768b7e9670a1496f0802ca050cd1e22d672aae (diff) | |
download | logilab-common-0370f99786e1bc6665c3866c521760cc1bd73067.tar.gz |
[work in progress] add a test reproducing bug #6011 (bug in lgc.configuration / default values)
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_configuration.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py index 6e2c981..e60bb3a 100644 --- a/test/unittest_configuration.py +++ b/test/unittest_configuration.py @@ -7,12 +7,12 @@ from logilab.common.testlib import TestCase, unittest_main from logilab.common.configuration import Configuration, OptionValueError, \ OptionsManagerMixIn, OptionsProviderMixIn, Method, read_old_config -options = [('dothis', {'type':'yn', 'default': True, 'metavar': '<y or n>'}), +options = [('dothis', {'type':'yn', 'action': 'store', 'default': True, 'metavar': '<y or n>'}), ('value', {'type': 'string', 'metavar': '<string>', 'short': 'v'}), ('multiple', {'type': 'csv', 'default': ('yop',), 'metavar': '<comma separated values>', 'help': 'you can also document the option'}), - ('number', {'type': 'int', 'default':2, 'metavar':'<int>'}), + ('number', {'type': 'int', 'default':2, 'metavar':'<int>', 'help': 'boom'}), ('choice', {'type': 'choice', 'default':'yo', 'choices': ('yo', 'ye'), 'metavar':'<yo|ye>'}), ('multiple-choice', {'type': 'multiple_choice', 'default':('yo', 'ye'), @@ -56,6 +56,7 @@ class ConfigurationTC(TestCase): def test_load_command_line_configuration(self): cfg = self.cfg + cfg.load_file_configuration() args = cfg.load_command_line_configuration(['--choice', 'ye', '--number', '4', '--multiple=1,2,3', '--dothis=n', 'other', 'arguments']) |