From e00bf792077d59b3344f0d14f3192806c42d54bd Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 13 Jun 2011 17:03:47 +0200 Subject: root submodule: Added parent_commit parameter for convenience. Fixed submodule tests to run --- git/test/objects/test_submodule.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'git/test/objects/test_submodule.py') 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') -- cgit v1.2.3