From 138aa2b8b413a19ebf9b2bbb39860089c4436001 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 27 Oct 2009 20:57:54 +0100 Subject: Added non-fast forward test case, fixed parsing issue caused by initial line stripping --- test/git/test_remote.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'test/git') diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 3b145468..1d343c74 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -43,17 +43,28 @@ class TestRemote(TestBase): res = remote.fetch() self._test_fetch_result(res, remote) + # all uptodate + for info in res: + assert info.flags & info.BRANCH_UPTODATE # rewind remote head to trigger rejection # index must be false as remote is a bare repo - remote_repo.head.reset("HEAD~2", index=False) + rhead = remote_repo.head + remote_commit = rhead.commit + rhead.reset("HEAD~2", index=False) res = remote.fetch() self._test_fetch_result(res, remote) - master_info = res["%s/master" % remote] + mkey = "%s/master" % remote + master_info = res[mkey] assert master_info.flags & Remote.FetchInfo.FORCED_UPDATE and master_info.note is not None - self.fail("test parsing of each individual flag") - self.fail("tag handling") + # normal fast forward - set head back to previous one + rhead.commit = remote_commit + res = remote.fetch() + self._test_fetch_result(res, remote) + assert res[mkey].flags & Remote.FetchInfo.FAST_FORWARD + + 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.3