summaryrefslogtreecommitdiff
path: root/test/git/test_remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-19 21:31:55 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-19 21:31:55 +0200
commit53d26977f1aff8289f13c02ee672349d78eeb2f0 (patch)
tree2f19b97289d9d0af2eeea894dcc1f51e627261cf /test/git/test_remote.py
parentcbf957a36f5ed47c4387ee8069c56b16d1b4f558 (diff)
downloadgitpython-53d26977f1aff8289f13c02ee672349d78eeb2f0.tar.gz
remote: added tests for creation and removal, finishing the remote interface
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r--test/git/test_remote.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/git/test_remote.py b/test/git/test_remote.py
index ac282908..2446710f 100644
--- a/test/git/test_remote.py
+++ b/test/git/test_remote.py
@@ -49,7 +49,7 @@ class TestRemote(TestCase):
assert writer.get(opt) == val
del(writer)
assert getattr(remote, opt) == val
- # END
+ # END for each default option key
# RENAME
other_name = "totally_other_name"
@@ -69,6 +69,21 @@ class TestRemote(TestCase):
def test_creation_and_removal(self):
- self.fail( "Test remote creation/removal" )
+ new_name = "test_new_one"
+ arg_list = (new_name, "git@server:hello.git")
+ remote = Remote.create(self.repo, *arg_list )
+ assert remote.name == "test_new_one"
+
+ # create same one again
+ self.failUnlessRaises(GitCommandError, Remote.create, self.repo, *arg_list)
+
+ Remote.remove(self.repo, new_name)
+
+ for remote in self.repo.remotes:
+ if remote.name == new_name:
+ raise AssertionError("Remote removal failed")
+ # END if deleted remote matches existing remote's name
+ # END for each remote
+