diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-28 18:09:18 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-28 18:09:18 +0100 |
commit | a519942a295cc39af4eebb7ba74b184decae13fb (patch) | |
tree | bd9622deae2a72102c809272b758d31aa1ca9ba8 /test/git/test_remote.py | |
parent | 4712c619ed6a2ce54b781fe404fedc269b77e5dd (diff) | |
download | gitpython-a519942a295cc39af4eebb7ba74b184decae13fb.tar.gz |
Tried to use shallow repository - this works in case it is remote, but unfortunately, deepening the repository fails if the server is used. This is bad, but a workaround is to create another shared repo which pushes a changes that we fetch into our given repo. This should provide more output to properly test the fetch handling. Harder than I thought
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r-- | test/git/test_remote.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 152ef5ab..99f64756 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -6,7 +6,8 @@ from test.testlib import * from git import * - +import tempfile +import shutil import os class TestRemote(TestBase): @@ -122,6 +123,20 @@ class TestRemote(TestBase): res = fetch_and_test(remote, tags=True) self.failUnlessRaises(IndexError, get_info, res, remote, str(rtag)) + # provoke to receive actual objects to see what kind of output we have to + # expect. Previously we did not really receive new objects + # This will only work for true remote repositories, not for local ones ! + if not remote.config_reader.get('url').startswith("git://"): + return + + shallow_repo_dir = tempfile.mktemp("shallow_repo") + shallow_repo = remote_repo.clone(shallow_repo_dir, depth=1, shared=False) + try: + res = shallow_repo.remotes.origin.fetch(depth=10) + finally: + shutil.rmtree(shallow_repo_dir) + # END test and cleanup + def _test_push_and_pull(self,remote, rw_repo, remote_repo): # push our changes lhead = rw_repo.head @@ -149,7 +164,7 @@ class TestRemote(TestBase): remote.pull('master') @with_rw_and_rw_remote_repo('0.1.6') - def test_base(self, rw_repo, remote_repo, damon_handle): + def test_base(self, rw_repo, remote_repo): num_remotes = 0 remote_set = set() |