summaryrefslogtreecommitdiff
path: root/test/git/test_repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
commitfd96cceded27d1372bdc1a851448d2d8613f60f3 (patch)
tree5b53f288a3379e260f46a65d08691fceec4a0ca3 /test/git/test_repo.py
parent6917ae4ce9eaa0f5ea91592988c1ea830626ac3a (diff)
parentc3bd05b426a0e3dec8224244c3c9c0431d1ff130 (diff)
downloadgitpython-fd96cceded27d1372bdc1a851448d2d8613f60f3.tar.gz
Merge branch 'docs'
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r--test/git/test_repo.py55
1 files changed, 14 insertions, 41 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index a3ff564d..551140a1 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -7,7 +7,7 @@
import os, sys
from test.testlib import *
from git import *
-from git.utils import join_path_native
+from git.util import join_path_native
import tempfile
import shutil
from cStringIO import StringIO
@@ -131,7 +131,20 @@ class TestRepo(TestBase):
assert os.path.isdir(r.git_dir)
self._test_empty_repo(r)
+
+ # test clone
+ clone_path = path + "_clone"
+ rc = r.clone(clone_path)
+ self._test_empty_repo(rc)
+
shutil.rmtree(git_dir_abs)
+ try:
+ shutil.rmtree(clone_path)
+ except OSError:
+ # when relative paths are used, the clone may actually be inside
+ # of the parent directory
+ pass
+ # END exception handling
# END for each path
os.makedirs(git_dir_rela)
@@ -151,46 +164,6 @@ class TestRepo(TestBase):
def test_bare_property(self):
self.rorepo.bare
- @patch_object(Repo, '__init__')
- @patch_object(Git, '_call_process')
- def test_init_with_options(self, git, repo):
- git.return_value = True
- repo.return_value = None
-
- r = Repo.init("repos/foo/bar.git", **{'bare' : True,'template': "/baz/sweet"})
- assert isinstance(r, Repo)
-
- assert_true(git.called)
- assert_true(repo.called)
-
- @patch_object(Repo, '__init__')
- @patch_object(Git, '_call_process')
- def test_clone(self, git, repo):
- git.return_value = None
- repo.return_value = None
-
- self.rorepo.clone("repos/foo/bar.git")
-
- assert_true(git.called)
- path = os.path.join(absolute_project_path(), '.git')
- assert_equal(git.call_args, (('clone', path, 'repos/foo/bar.git'), {}))
- assert_true(repo.called)
-
- @patch_object(Repo, '__init__')
- @patch_object(Git, '_call_process')
- def test_clone_with_options(self, git, repo):
- git.return_value = None
- repo.return_value = None
-
- self.rorepo.clone("repos/foo/bar.git", **{'template': '/awesome'})
-
- assert_true(git.called)
- path = os.path.join(absolute_project_path(), '.git')
- assert_equal(git.call_args, (('clone', path, 'repos/foo/bar.git'),
- { 'template': '/awesome'}))
- assert_true(repo.called)
-
-
def test_daemon_export(self):
orig_val = self.rorepo.daemon_export
self.rorepo.daemon_export = not orig_val