diff options
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/test_git.py | 16 | ||||
-rw-r--r-- | git/test/test_remote.py | 5 |
2 files changed, 15 insertions, 6 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py index 742c842d..a4172f7a 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -192,10 +192,14 @@ class TestGit(TestBase): rw_repo = Repo.init(os.path.join(rw_dir, 'repo')) remote = rw_repo.create_remote('ssh-origin', "ssh://git@server/foo") - with rw_repo.git.custom_environment(GIT_SSH=path): - try: - remote.fetch() - except GitCommandError as err: - assert 'FOO' in str(err) + # This only works if we are not evaluating git-push/pull output in a thread ! + import select + if hasattr(select, 'poll'): + with rw_repo.git.custom_environment(GIT_SSH=path): + try: + remote.fetch() + except GitCommandError as err: + assert 'FOO' in str(err) + # end # end - # end + # end if select.poll exists diff --git a/git/test/test_remote.py b/git/test/test_remote.py index af854988..6c37614d 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -494,6 +494,11 @@ class TestRemote(TestBase): fetch_info_line_fmt = "c437ee5deb8d00cf02f03720693e4c802e99f390 not-for-merge %s '0.3' of " fetch_info_line_fmt += "git://github.com/gitpython-developers/GitPython" remote_info_line_fmt = "* [new branch] nomatter -> %s" + + self.failUnlessRaises(ValueError, FetchInfo._from_line, self.rorepo, + remote_info_line_fmt % "refs/something/branch", + "269c498e56feb93e408ed4558c8138d750de8893\t\t/Users/ben/test/foo\n") + fi = FetchInfo._from_line(self.rorepo, remote_info_line_fmt % "local/master", fetch_info_line_fmt % 'remote-tracking branch') |