summaryrefslogtreecommitdiff
path: root/test/testlib/helper.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-04 21:39:22 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-04 21:39:22 +0100
commit453995f70f93c0071c5f7534f58864414f01cfde (patch)
tree1879f5e02587484ccd56cb371e02cd2ad4bc401d /test/testlib/helper.py
parentec1f9c9e9a6ce14ddc69b6be65188b3438f31f23 (diff)
downloadgitpython-453995f70f93c0071c5f7534f58864414f01cfde.tar.gz
improved error when setting up server based test to make clear a server needs to be started
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r--test/testlib/helper.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/testlib/helper.py b/test/testlib/helper.py
index 4ab7207d..27c2b3d9 100644
--- a/test/testlib/helper.py
+++ b/test/testlib/helper.py
@@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
-from git import Repo, Remote
+from git import Repo, Remote, GitCommandError
from unittest import TestCase
import tempfile
import shutil
@@ -166,7 +166,15 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
# by the user, not by us
d_remote = Remote.create(rw_repo, "daemon_origin", remote_repo_dir)
d_remote.fetch()
- d_remote.config_writer.set('url', "git://localhost%s" % remote_repo_dir)
+ remote_repo_url = "git://localhost%s" % remote_repo_dir
+ d_remote.config_writer.set('url', remote_repo_url)
+
+ # try to list remotes to diagnoes whether the server is up
+ try:
+ rw_repo.git.ls_remote(d_remote)
+ except GitCommandError,e:
+ print str(e)
+ raise AssertionError('Please start a git-daemon to run this test, execute: git-daemon "%s"'%tempfile.gettempdir())
try:
return func(self, rw_repo, rw_remote_repo)