diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-12 10:25:10 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-12 10:25:15 +0100 |
commit | dfb0a9c4bca590efaa86f8edc3fdb62bd536bce7 (patch) | |
tree | 442e289ab6202de3434f566e84fd4a09753ed5b2 | |
parent | acd82464a11f3c2d3edc1d152d028a142da31a9f (diff) | |
download | gitpython-dfb0a9c4bca590efaa86f8edc3fdb62bd536bce7.tar.gz |
Added specific test for roughly checking configuration paths.
For some reason, I didn't trust the existing one as it tests that code
more indirectly.
Related to #160
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | git/repo/base.py | 2 | ||||
-rw-r--r-- | git/test/test_repo.py | 5 |
3 files changed, 7 insertions, 2 deletions
@@ -10,6 +10,6 @@ cover/ /doc/_build nbproject *.sublime-workspace - +.DS_Store /*egg-info /.tox diff --git a/git/repo/base.py b/git/repo/base.py index 5a93a5a2..d6e55553 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -354,7 +354,7 @@ class Repo(object): if config_level == "system": return "/etc/gitconfig" elif config_level == "user": - config_home = os.environ.get("XDG_CONFIG_HOME") or join(os.environ.get("HOME", '~'), ".config") + config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.environ.get("HOME", '~'), ".config") return os.path.expanduser(join(config_home, "git", "config")) elif config_level == "global": return os.path.normpath(os.path.expanduser("~/.gitconfig")) diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 3abd9cd0..046b20a7 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -365,6 +365,11 @@ class TestRepo(TestBase): pass # END for each config level + def test_config_level_paths(self): + for config_level in self.rorepo.config_level: + assert self.rorepo._get_config_path(config_level) + # end for each config level + def test_creation_deletion(self): # just a very quick test to assure it generally works. There are # specialized cases in the test_refs module |