From 87afd252bd11026b6ba3db8525f949cfb62c90fc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 28 Oct 2009 10:58:24 +0100 Subject: tag handling tests finished, unfortunately there is not yet a rejected case, but it will assuambly follow with the push tests --- test/git/test_remote.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 638cb103..6870e0e5 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -106,14 +106,22 @@ class TestRemote(TestBase): # 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.ref, TagReference) - - # delete tag + tinfo = res[str(rtag)] + assert isinstance(tinfo.ref, TagReference) and tinfo.ref.commit == rtag.commit + assert tinfo.flags & tinfo.NEW_TAG # adjust tag commit + rtag.object = rhead.commit.parents[0].parents[0] + res = fetch_and_test(remote, tags=True) + tinfo = res[str(rtag)] + assert tinfo.commit == rtag.commit + assert tinfo.flags & tinfo.TAG_UPDATE + + # delete remote tag - local one will stay + TagReference.delete(remote_repo, rtag) + res = fetch_and_test(remote, tags=True) + self.failUnlessRaises(IndexError, get_info, res, remote, str(rtag)) - self.fail("tag handling, tag uptodate, new tag, new branch") def _test_pull(self,remote, rw_repo, remote_repo): # pull is essentially a fetch + merge, hence we just do a light -- cgit v1.2.1