aboutsummaryrefslogtreecommitdiff
path: root/git/test/objects/test_submodule.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-06-13 17:03:47 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-13 17:03:47 +0200
commite00bf792077d59b3344f0d14f3192806c42d54bd (patch)
tree659616b6680908f6a7e11ef0283a3b6e4d65bc1a /git/test/objects/test_submodule.py
parent7076f43567df4cd9531a771bff6c9b3ecd313252 (diff)
downloadGitPython-e00bf792077d59b3344f0d14f3192806c42d54bd.tar.gz
GitPython-e00bf792077d59b3344f0d14f3192806c42d54bd.zip
root submodule: Added parent_commit parameter for convenience. Fixed submodule tests to run
Diffstat (limited to 'git/test/objects/test_submodule.py')
-rw-r--r--git/test/objects/test_submodule.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/git/test/objects/test_submodule.py b/git/test/objects/test_submodule.py
index 8e22cc6d..530806fb 100644
--- a/git/test/objects/test_submodule.py
+++ b/git/test/objects/test_submodule.py
@@ -394,15 +394,17 @@ class TestSubmodule(TestObjectBase):
@with_rw_repo(k_subm_current, bare=False)
def test_root_module(self, rwrepo):
# Can query everything without problems
- rm = RootModule(self.rorepo)
- assert rm.module() is self.rorepo
+ rm = RootModule(rwrepo)
+ # test new constructor
+ assert rm.parent_commit == RootModule(self.rorepo, self.rorepo.commit(self.k_subm_current)).parent_commit
+ assert rm.module() is rwrepo
# try attributes
rm.binsha
rm.mode
rm.path
assert rm.name == rm.k_root_name
- assert rm.parent_commit == self.rorepo.head.commit
+ assert rm.parent_commit == self.rorepo.commit(self.k_subm_current)
rm.url
rm.branch
@@ -412,7 +414,7 @@ class TestSubmodule(TestObjectBase):
# deep traversal git / async
rsmsp = [sm.path for sm in rm.traverse()]
- assert len(rsmsp) == 2 # git, async, smmap, async being a child of git.
+ assert len(rsmsp) == 1 # gitdb only - its not yet uptodate so it has no submodule
# cannot set the parent commit as root module's path didn't exist
self.failUnlessRaises(ValueError, rm.set_parent_commit, 'HEAD')