summaryrefslogtreecommitdiff
path: root/test/git/test_remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-22 16:20:35 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-22 16:20:35 +0200
commit3c658c16f3437ed7e78f6072b6996cb423a8f504 (patch)
tree4dcb21b565410c48878be31deebbb441201d542b /test/git/test_remote.py
parent59e26435a8d2008073fc315bafe9f329d0ef689a (diff)
parentb197b2dbb527de9856e6e808339ab0ceaf0a512d (diff)
downloadgitpython-3c658c16f3437ed7e78f6072b6996cb423a8f504.tar.gz
Merge branch 'testsystem' into improvements
* testsystem: Adjusted all remaining test suites to use the new TestBase class where appropriate Fixed decorator issue that would cause a function to be passed even though there is a default argument. This feels inconsistent as the 'argument passer' wrapper function can be called with a function or a string as first argument depending on whether the client code was explicitly passing an argument or not. That ... sucks. Now test for that case specifically and fail with a proper assertion error. I don't like it, but what can I do ... . Implemented decorators, tests pass at least Added frame for new Repo handling and some neat decorators, including tests that test whether the testing framework does what it should
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r--test/git/test_remote.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/test/git/test_remote.py b/test/git/test_remote.py
index aeb6b4af..ef00056d 100644
--- a/test/git/test_remote.py
+++ b/test/git/test_remote.py
@@ -7,16 +7,13 @@
from test.testlib import *
from git import *
-class TestRemote(TestCase):
+class TestRemote(TestBase):
- @classmethod
- def setUpAll(cls):
- cls.repo = Repo(GIT_REPO)
-
- def test_base(self):
+ @with_rw_and_rw_remote_repo('0.1.6')
+ def test_base(self, rw_repo, remote_repo):
num_remotes = 0
remote_set = set()
- for remote in self.repo.remotes:
+ for remote in rw_repo.remotes:
num_remotes += 1
assert remote == remote
assert str(remote) != repr(remote)
@@ -64,27 +61,29 @@ class TestRemote(TestCase):
remote.fetch()
self.failUnlessRaises(GitCommandError, remote.pull)
+ remote.pull('master')
remote.update()
self.fail("test push once there is a test-repo")
# END for each remote
assert num_remotes
assert num_remotes == len(remote_set)
- origin = self.repo.remote('origin')
- assert origin == self.repo.remotes.origin
+ origin = rw_repo.remote('origin')
+ assert origin == rw_repo.remotes.origin
- def test_creation_and_removal(self):
+ @with_bare_rw_repo
+ def test_creation_and_removal(self, bare_rw_repo):
new_name = "test_new_one"
arg_list = (new_name, "git@server:hello.git")
- remote = Remote.create(self.repo, *arg_list )
+ remote = Remote.create(bare_rw_repo, *arg_list )
assert remote.name == "test_new_one"
# create same one again
- self.failUnlessRaises(GitCommandError, Remote.create, self.repo, *arg_list)
+ self.failUnlessRaises(GitCommandError, Remote.create, bare_rw_repo, *arg_list)
- Remote.remove(self.repo, new_name)
+ Remote.remove(bare_rw_repo, new_name)
- for remote in self.repo.remotes:
+ for remote in bare_rw_repo.remotes:
if remote.name == new_name:
raise AssertionError("Remote removal failed")
# END if deleted remote matches existing remote's name