diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 14:28:22 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 14:48:18 +0100 |
commit | ec3d91644561ef59ecdde59ddced38660923e916 (patch) | |
tree | 4e18b08cf9fcda3be762522113151dbd1063885e /test/git/test_remote.py | |
parent | e70f3218e910d2b3dcb8a5ab40c65b6bd7a8e9a8 (diff) | |
download | gitpython-ec3d91644561ef59ecdde59ddced38660923e916.tar.gz |
Finished all push tests I could think of so far. More error cases should be studied, but they would be hard to 'produce'
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 306d0da3..156e7764 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -299,17 +299,34 @@ class TestRemote(TestBase): self._test_push_result(res, remote) assert res[0].flags & PushInfo.DELETED - self.fail("test --all") - # push new branch + new_head = Head.create(rw_repo, "my_new_branch") + progress = TestPushProgress() + res = remote.push(new_head, progress) + assert res[0].flags & PushInfo.NEW_HEAD + progress.make_assertion() + self._test_push_result(res, remote) - # delete new branch + # delete new branch on the remote end and locally + res = remote.push(":%s" % new_head.path) + self._test_push_result(res, remote) + Head.delete(rw_repo, new_head) + assert res[-1].flags & PushInfo.DELETED + + # --all + res = remote.push(all=True) + self._test_push_result(res, remote) # pull is essentially a fetch + merge, hence we just do a light # test here, leave the reset to the actual merge testing # fails as we did not specify a branch and there is no configuration for it self.failUnlessRaises(GitCommandError, remote.pull) remote.pull('master') + + # cleanup - delete created tags and branches as we are in an innerloop on + # the same repository + TagReference.delete(rw_repo, new_tag, other_tag) + remote.push(":%s" % other_tag.path) @with_rw_and_rw_remote_repo('0.1.6') def test_base(self, rw_repo, remote_repo): |