From fe9f925c3cd4703ecf9409544d8692d677e32ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Wed, 19 Jun 2013 00:25:53 +0200 Subject: GbpOptionParser: Make sure we parse the old config sections For backward compatibility between {gbp,git}- and "gbp " make sure we parse the former sections if using the later. --- tests/test_Config.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/test_Config.py b/tests/test_Config.py index 3f19dc58..9fe7dd48 100644 --- a/tests/test_Config.py +++ b/tests/test_Config.py @@ -59,3 +59,24 @@ def test_tristate(): >>> options.color auto """ + +def test_parser_fallback(): + """ + Make sure we also parse git- sections if + gbp was used. + + >>> import os + >>> from gbp.config import GbpOptionParser + >>> parser = GbpOptionParser('foo') + >>> tmpdir = str(context.new_tmpdir('foo')) + >>> confname = os.path.join(tmpdir, 'gbp.conf') + >>> parser.config_files = [confname] + >>> f = file(confname, 'w') + >>> f.write('[foo]\\nthere = is\\n[git-foo]\\nno = truth\\n') + >>> f.close() + >>> parser._parse_config_files() + >>> parser.config['there'] + 'is' + >>> parser.config['no'] + 'truth' + """ -- cgit v1.2.3