diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-15 16:52:20 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-15 16:52:20 +0200 |
commit | 00c5497f190172765cc7a53ff9d8852a26b91676 (patch) | |
tree | 63163a2d92d1e35dd419492af906c42de75e586d /test/git/test_repo.py | |
parent | 806450db9b2c4a829558557ac90bd7596a0654e0 (diff) | |
download | gitpython-00c5497f190172765cc7a53ff9d8852a26b91676.tar.gz |
repo: made init and clone methods less specific, previously they wanted to do it 'barely' only. New method names closely follow the default git command names
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index cefd1349..cbfc27c4 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -67,55 +67,53 @@ class TestRepo(object): @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_init_bare(self, git, repo): + def test_init(self, git, repo): git.return_value = True repo.return_value = None - Repo.init_bare("repos/foo/bar.git") + r = Repo.init("repos/foo/bar.git", bare=True) + assert isinstance(r, Repo) assert_true(git.called) - assert_equal(git.call_args, (('init', '--bare'), {})) assert_true(repo.called) - assert_equal(repo.call_args, (('repos/foo/bar.git',), {})) @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_init_bare_with_options(self, git, repo): + def test_init_with_options(self, git, repo): git.return_value = True repo.return_value = None - Repo.init_bare("repos/foo/bar.git", **{'template': "/baz/sweet"}) + r = Repo.init("repos/foo/bar.git", **{'bare' : True,'template': "/baz/sweet"}) + assert isinstance(r, Repo) assert_true(git.called) - assert_equal(git.call_args, (('init', '--bare'), {'template': '/baz/sweet'})) assert_true(repo.called) - assert_equal(repo.call_args, (('repos/foo/bar.git',), {})) @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_fork_bare(self, git, repo): + def test_clone(self, git, repo): git.return_value = None repo.return_value = None - self.repo.fork_bare("repos/foo/bar.git") + self.repo.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'), {'bare': True})) + 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_fork_bare_with_options(self, git, repo): + def test_clone_with_options(self, git, repo): git.return_value = None repo.return_value = None - self.repo.fork_bare("repos/foo/bar.git", **{'template': '/awesome'}) + self.repo.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'), - {'bare': True, 'template': '/awesome'})) + { 'template': '/awesome'})) assert_true(repo.called) @patch_object(Git, '_call_process') |