diff options
Diffstat (limited to 'tests/test_Config.py')
-rw-r--r-- | tests/test_Config.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_Config.py b/tests/test_Config.py index 9fe7dd48..995d6196 100644 --- a/tests/test_Config.py +++ b/tests/test_Config.py @@ -80,3 +80,27 @@ def test_parser_fallback(): >>> parser.config['no'] 'truth' """ + +def test_filter(): + """ + The filter option should always parse as a list + >>> import os + >>> from gbp.config import GbpOptionParser + >>> parser = GbpOptionParser('bar') + >>> tmpdir = str(context.new_tmpdir('bar')) + >>> confname = os.path.join(tmpdir, 'gbp.conf') + >>> parser.config_files = [confname] + >>> f = file(confname, 'w') + >>> f.write('[bar]\\nfilter = asdf\\n') + >>> f.close() + >>> parser._parse_config_files() + >>> parser.config['filter'] + ['asdf'] + >>> f = file(confname, 'w') + >>> f.write("[bar]\\nfilter = ['this', 'is', 'a', 'list']\\n") + >>> f.close() + >>> parser._parse_config_files() + >>> parser.config['filter'] + ['this', 'is', 'a', 'list'] + """ + |