summaryrefslogtreecommitdiff
path: root/test/git/test_remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-27 20:57:54 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-10-27 20:57:54 +0100
commit138aa2b8b413a19ebf9b2bbb39860089c4436001 (patch)
treef29dde05462e6d2d8d30957e9eb67163e4122d04 /test/git/test_remote.py
parent038f183313f796dc0313c03d652a2bcc1698e78e (diff)
downloadgitpython-138aa2b8b413a19ebf9b2bbb39860089c4436001.tar.gz
Added non-fast forward test case, fixed parsing issue caused by initial line stripping
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r--test/git/test_remote.py19
1 files changed, 15 insertions, 4 deletions
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