diff options
author | Odegard, Ken <ken.odegard@gmail.com> | 2017-07-09 22:07:31 +0200 |
---|---|---|
committer | Odegard, Ken <ken.odegard@gmail.com> | 2017-07-09 22:07:31 +0200 |
commit | aba0494701292e916761076d6d9f8beafa44c421 (patch) | |
tree | 3ec1776eb8e1915d52f5799e9b030e6dba5943d8 /git/test/test_git.py | |
parent | feed81ea1a332dc415ea9010c8b5204473a51bdf (diff) | |
download | gitpython-aba0494701292e916761076d6d9f8beafa44c421.tar.gz |
Renamed refresh to setup and removed alias function & added unittest
Renamed to simplify and avoid issue with nose tests trying to use
`setup` as a setup for testing. Unittest implements basic test for
refreshing with a bad git path versus a good git path.
Diffstat (limited to 'git/test/test_git.py')
-rw-r--r-- | git/test/test_git.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py index 3c8b6f82..00577e33 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -10,6 +10,7 @@ import sys from git import ( Git, + refresh, GitCommandError, GitCommandNotFound, Repo, @@ -156,6 +157,14 @@ class TestGit(TestBase): type(self.git).GIT_PYTHON_GIT_EXECUTABLE = prev_cmd # END undo adjustment + def test_refresh(self): + # test a bad git path refresh + self.assertRaises(GitCommandNotFound, refresh, "yada") + + # test a good path refresh + path = os.popen("which git").read().strip() + refresh(path) + def test_options_are_passed_to_git(self): # This work because any command after git --version is ignored git_version = self.git(version=True).NoOp() |