summaryrefslogtreecommitdiff
path: root/git/test/test_config.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2017-12-11 15:16:32 +0100
committerSebastian Thiel <byronimo@gmail.com>2017-12-11 15:16:32 +0100
commit0a6cb4aab975a35e9ca7f28c1814aa13203ab835 (patch)
tree1b719856eec3a5e16ff0d977dd538df03b792ce5 /git/test/test_config.py
parenta14277eecf65ac216dd1b756acee8c23ecdf95d9 (diff)
parentd2c1d194064e505fa266bd1878c231bb7da921ea (diff)
downloadgitpython-0a6cb4aab975a35e9ca7f28c1814aa13203ab835.tar.gz
Merge branch 'bf-includes' of https://github.com/yarikoptic/GitPython into yarikoptic-bf-includes
Diffstat (limited to 'git/test/test_config.py')
-rw-r--r--git/test/test_config.py16
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')