diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-15 19:03:53 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-15 19:03:53 +0100 |
commit | 624556eae1c292a1dc283d9dca1557e28abe8ee3 (patch) | |
tree | a90ef1572044f113d3dae587f67f6ca51593ba07 /test/git | |
parent | f97653aa06cf84bcf160be3786b6fce49ef52961 (diff) | |
download | gitpython-624556eae1c292a1dc283d9dca1557e28abe8ee3.tar.gz |
Optimized test-decorators, by completely removing with_bare_rw_repo, which was mainly copy-paste from with_rw_repo, what a shame
Diffstat (limited to 'test/git')
-rw-r--r-- | test/git/test_base.py | 2 | ||||
-rw-r--r-- | test/git/test_commit.py | 2 | ||||
-rw-r--r-- | test/git/test_remote.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 2 | ||||
-rw-r--r-- | test/git/test_submodule.py | 2 | ||||
-rw-r--r-- | test/git/test_tree.py | 2 |
6 files changed, 7 insertions, 5 deletions
diff --git a/test/git/test_base.py b/test/git/test_base.py index db13feae..25d1e4e9 100644 --- a/test/git/test_base.py +++ b/test/git/test_base.py @@ -83,7 +83,7 @@ class TestBase(TestBase): # objects must be resolved to shas so they compare equal assert self.rorepo.head.reference.object == self.rorepo.active_branch.object - @with_bare_rw_repo + @with_rw_repo('HEAD', bare=True) def test_with_bare_rw_repo(self, bare_rw_repo): assert bare_rw_repo.config_reader("repository").getboolean("core", "bare") assert os.path.isfile(os.path.join(bare_rw_repo.git_dir,'HEAD')) diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 2692938f..c3ce5c92 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -237,7 +237,7 @@ class TestCommit(TestBase): name_rev = self.rorepo.head.commit.name_rev assert isinstance(name_rev, basestring) - @with_bare_rw_repo + @with_rw_repo('HEAD', bare=True) def test_serialization(self, rwrepo): # create all commits of our repo assert_commit_serialization(rwrepo, '0.1.6') diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 1db4bc32..c52f907e 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -422,7 +422,7 @@ class TestRemote(TestBase): origin = rw_repo.remote('origin') assert origin == rw_repo.remotes.origin - @with_bare_rw_repo + @with_rw_repo('HEAD', bare=True) def test_creation_and_removal(self, bare_rw_repo): new_name = "test_new_one" arg_list = (new_name, "git@server:hello.git") diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 063b5dff..3a59f05e 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -558,7 +558,7 @@ class TestRepo(TestBase): def test_submodules(self): assert len(self.rorepo.submodules) == 1 # non-recursive - assert len(self.rorepo.list_submodules(recursive=True)) == 2 + assert len(list(self.rorepo.iter_submodules())) == 2 assert isinstance(self.rorepo.submodule("lib/git/ext/gitdb"), Submodule) self.failUnlessRaises(ValueError, self.rorepo.submodule, "doesn't exist") diff --git a/test/git/test_submodule.py b/test/git/test_submodule.py index 2ca0b269..ac179c22 100644 --- a/test/git/test_submodule.py +++ b/test/git/test_submodule.py @@ -105,7 +105,7 @@ class TestSubmodule(TestBase): def test_base_rw(self, rwrepo): self._do_base_tests(rwrepo) - @with_bare_rw_repo + @with_rw_repo(k_subm_current, bare=True) def test_base_bare(self, rwrepo): self._do_base_tests(rwrepo) diff --git a/test/git/test_tree.py b/test/git/test_tree.py index d08999bd..18688424 100644 --- a/test/git/test_tree.py +++ b/test/git/test_tree.py @@ -102,6 +102,8 @@ class TestTree(TestBase): assert isinstance(obj, (Blob, Tree)) all_items.append(obj) # END for each object + assert all_items == root.list_traverse() + # limit recursion level to 0 - should be same as default iteration assert all_items assert 'CHANGES' in root |