diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-27 22:36:41 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-27 22:36:41 +0100 |
commit | 29c20c147b489d873fb988157a37bcf96f96ab45 (patch) | |
tree | f59c6023ffda3719086d87b025a613bdc57d0af0 /test/git/test_remote.py | |
parent | b1f32e231d391f8e6051957ad947d3659c196b2b (diff) | |
download | gitpython-29c20c147b489d873fb988157a37bcf96f96ab45.tar.gz |
Added special cases to test that shows we cannot yet:
handle the FETCH_HEAD case and
handle tags
System needs to be adjusted to take the FETCH_HEAD info into account to cover the tags case
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r-- | test/git/test_remote.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 047ff8f2..91d63ffd 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -18,7 +18,7 @@ class TestRemote(TestBase): def _test_fetch_result(self, results, remote): - # self._print_fetchhead(remote.repo) + self._print_fetchhead(remote.repo) assert len(results) > 0 and isinstance(results[0], remote.FetchInfo) for info in results: assert info.flags != 0 @@ -38,8 +38,8 @@ class TestRemote(TestBase): # specialized fetch testing to de-clutter the main test self._test_fetch_info(rw_repo) - def fetch_and_test(remote): - res = remote.fetch() + def fetch_and_test(remote, **kwargs): + res = remote.fetch(**kwargs) self._test_fetch_result(res, remote) return res # END fetch and check @@ -93,6 +93,23 @@ class TestRemote(TestBase): assert len(stale_refs) == 2 and isinstance(stale_refs[0], RemoteReference) RemoteReference.delete(rw_repo, *stale_refs) + # test single branch fetch with refspec + res = fetch_and_test(remote, refspec="master:refs/remotes/%s/master"%remote) + assert len(res) == 1 and get_info(res, remote, 'master') + + # without refspec + res = fetch_and_test(remote, refspec='master') + assert len(res) == 1 + + # add new tag reference + rtag = TagReference.create(remote_repo, "1.0-RV_hello.there") + res = fetch_and_test(remote, tags=True) + ltag = res[str(rtag)] + assert isinstance(ltag, TagReference) + + # delete tag + + # adjust tag commit self.fail("tag handling, tag uptodate, new tag, new branch") |