summaryrefslogtreecommitdiff
path: root/git/test/test_remote.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-04 14:29:28 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-12 23:31:43 +0200
commit4b586fbb94d5acc6e06980a8a96f66771280beda (patch)
tree87f63f2916114b56ade83d0b9653d1d4b61f263c /git/test/test_remote.py
parent8ea7e265d1549613c12cbe42a2e012527c1a97e4 (diff)
downloadgitpython-4b586fbb94d5acc6e06980a8a96f66771280beda.tar.gz
daemon, #525: FIX remote urls in config-files
+ Parse most remote & config-urls \-->/. + Used relative daemon-paths. + Use git-daemon PORT above 10k; on Windows all below need Admin rights. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + test_base.test_with_rw_remote_and_rw_repo() PASS. + test_remote.test_base() now freezes! (so still hidden win_err) + repo_test: minor finally delete test-repos created inside this repo. + util: delete unused `absolute_project_path()`.
Diffstat (limited to 'git/test/test_remote.py')
-rw-r--r--git/test/test_remote.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index e0b00e0c..8382d7fa 100644
--- a/git/test/test_remote.py
+++ b/git/test/test_remote.py
@@ -28,8 +28,11 @@ from git import (
from git.util import IterableList, rmtree
from git.compat import string_types
import tempfile
-import os
+import os.path as osp
import random
+from unittest.case import skipIf
+from git.util import HIDE_WINDOWS_KNOWN_ERRORS
+from git.cmd import Git
# assure we have repeatable results
random.seed(0)
@@ -105,7 +108,7 @@ class TestRemote(TestBase):
gc.collect()
def _print_fetchhead(self, repo):
- with open(os.path.join(repo.git_dir, "FETCH_HEAD")):
+ with open(osp.join(repo.git_dir, "FETCH_HEAD")):
pass
def _do_test_fetch_result(self, results, remote):
@@ -156,7 +159,7 @@ class TestRemote(TestBase):
# Create a file with a random name and random data and commit it to repo.
# Return the commited absolute file path
index = repo.index
- new_file = self._make_file(os.path.basename(tempfile.mktemp()), str(random.random()), repo)
+ new_file = self._make_file(osp.basename(tempfile.mktemp()), str(random.random()), repo)
index.add([new_file])
index.commit("Committing %s" % new_file)
return new_file
@@ -263,7 +266,8 @@ class TestRemote(TestBase):
# must clone with a local path for the repo implementation not to freak out
# as it wants local paths only ( which I can understand )
other_repo = remote_repo.clone(other_repo_dir, shared=False)
- remote_repo_url = "git://localhost:%s%s" % (GIT_DAEMON_PORT, remote_repo.git_dir)
+ remote_repo_url = osp.basename(remote_repo.git_dir) # git-daemon runs with appropriate `--base-path`.
+ remote_repo_url = Git.polish_url("git://localhost:%s/%s" % (GIT_DAEMON_PORT, remote_repo_url))
# put origin to git-url
other_origin = other_repo.remotes.origin
@@ -384,12 +388,7 @@ class TestRemote(TestBase):
TagReference.delete(rw_repo, new_tag, other_tag)
remote.push(":%s" % other_tag.path)
- # @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """
- # FIXME: git-daemon failing with:
- # git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
- # cmdline: git ls-remote daemon_origin
- # stderr: 'fatal: bad config line 15 in file .git/config'
- # """)
+ @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, "FIXME: Freezes!")
@with_rw_and_rw_remote_repo('0.1.6')
def test_base(self, rw_repo, remote_repo):
num_remotes = 0