diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2017-12-11 15:26:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 15:26:23 +0100 |
commit | 03126bfd6e97ddcfb6bd8d4a893d2d04939f197e (patch) | |
tree | 583bdcea25683b3df9a81a6bd5bb8549fb3c5937 /git/test/test_config.py | |
parent | d5710466a728446d8169761d9d4c29b1cb752b00 (diff) | |
parent | 0a6cb4aab975a35e9ca7f28c1814aa13203ab835 (diff) | |
download | gitpython-03126bfd6e97ddcfb6bd8d4a893d2d04939f197e.tar.gz |
Merge pull request #700 from yarikoptic/bf-includes
BF: process included files before the rest
Diffstat (limited to 'git/test/test_config.py')
-rw-r--r-- | git/test/test_config.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/git/test/test_config.py b/git/test/test_config.py index 7cf9d317..4d6c8236 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -15,6 +15,7 @@ from git.config import cp from git.test.lib import ( TestCase, fixture_path, + SkipTest, ) from git.test.lib import with_rw_directory @@ -88,6 +89,21 @@ class TestBase(TestCase): assert r_config.get(sname, oname) == val # END for each filename + def test_includes_order(self): + with GitConfigParser(list(map(fixture_path, ("git_config", "git_config_global")))) as r_config: + r_config.read() # enforce reading + # Simple inclusions, again checking them taking precedence + assert r_config.get_value('sec', 'var0') == "value0_included" + # This one should take the git_config_global value since included + # values must be considered as soon as they get them + assert r_config.get_value('diff', 'tool') == "meld" + try: + assert r_config.get_value('sec', 'var1') == "value1_main" + except AssertionError: + raise SkipTest( + 'Known failure -- included values are not in effect right away' + ) + @with_rw_directory def test_lock_reentry(self, rw_dir): fpl = osp.join(rw_dir, 'l') |