diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-15 18:42:44 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-15 18:42:44 +0100 |
commit | f97653aa06cf84bcf160be3786b6fce49ef52961 (patch) | |
tree | 03d5469f124ab166137196c16bf39f628c962185 /test/git/test_repo.py | |
parent | 00ce31ad308ff4c7ef874d2fa64374f47980c85c (diff) | |
download | gitpython-f97653aa06cf84bcf160be3786b6fce49ef52961.tar.gz |
Repo: added submodule query and iteration methods similar to the ones provided for Remotes, including test
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 65dce590..063b5dff 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -208,8 +208,10 @@ class TestRepo(TestBase): assert_equal('<git.Repo "%s">' % path, repr(self.rorepo)) def test_is_dirty_with_bare_repository(self): + orig_value = self.rorepo._bare self.rorepo._bare = True assert_false(self.rorepo.is_dirty()) + self.rorepo._bare = orig_value def test_is_dirty(self): self.rorepo._bare = False @@ -220,8 +222,10 @@ class TestRepo(TestBase): # END untracked files # END working tree # END index + orig_val = self.rorepo._bare self.rorepo._bare = True assert self.rorepo.is_dirty() == False + self.rorepo._bare = orig_val def test_head(self): assert self.rorepo.head.reference.object == self.rorepo.active_branch.object @@ -552,3 +556,9 @@ class TestRepo(TestBase): target_type = GitCmdObjectDB assert isinstance(self.rorepo.odb, target_type) + def test_submodules(self): + assert len(self.rorepo.submodules) == 1 # non-recursive + assert len(self.rorepo.list_submodules(recursive=True)) == 2 + + assert isinstance(self.rorepo.submodule("lib/git/ext/gitdb"), Submodule) + self.failUnlessRaises(ValueError, self.rorepo.submodule, "doesn't exist") |