diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-10 22:45:07 +0200 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-13 16:39:53 +0200 |
| commit | 7076f43567df4cd9531a771bff6c9b3ecd313252 (patch) | |
| tree | a436a75f6de55a85f33727abf5a455ec80fae393 | |
| parent | 095013f9b8f7cbdbcbeda215c469be3da9e7d2b3 (diff) | |
| download | GitPython-7076f43567df4cd9531a771bff6c9b3ecd313252.tar.gz GitPython-7076f43567df4cd9531a771bff6c9b3ecd313252.zip | |
Fixed submodule tests to go with either the old or the new version of gitdb
| -rw-r--r-- | .gitmodules | 6 | ||||
| -rw-r--r-- | git/test/objects/test_submodule.py | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/.gitmodules b/.gitmodules index 57b06fc8..5741d992 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "git/ext/async"] - path = git/ext/async - url = git://github.com/gitpython-developers/async.git +[submodule "gitdb"] + path = git/ext/gitdb + url = git://github.com/gitpython-developers/gitdb.git diff --git a/git/test/objects/test_submodule.py b/git/test/objects/test_submodule.py index 14cb074c..8e22cc6d 100644 --- a/git/test/objects/test_submodule.py +++ b/git/test/objects/test_submodule.py @@ -284,10 +284,11 @@ class TestSubmodule(TestObjectBase): self.failUnlessRaises(InvalidGitRepositoryError, sm.remove) # forcibly delete the child repository + prev_count = len(sm.children()) assert csm.remove(force=True) is csm assert not csm.exists() assert not csm.module_exists() - assert len(sm.children()) == 0 + assert len(sm.children()) == prev_count - 1 # now we have a changed index, as configuration was altered. # fix this sm.module().index.reset(working_tree=True) @@ -411,7 +412,7 @@ class TestSubmodule(TestObjectBase): # deep traversal git / async rsmsp = [sm.path for sm in rm.traverse()] - assert len(rsmsp) == 1 # git and async, async being a child of git + assert len(rsmsp) == 2 # git, async, smmap, async being a child of git. # cannot set the parent commit as root module's path didn't exist self.failUnlessRaises(ValueError, rm.set_parent_commit, 'HEAD') @@ -564,13 +565,13 @@ class TestSubmodule(TestObjectBase): # ================= # finally we recursively update a module, just to run the code at least once # remove the module so that it has more work - assert len(nsm.children()) == 1 - assert nsm.exists() and nsm.module_exists() and len(nsm.children()) == 1 + assert len(nsm.children()) >= 1 # could include smmap + assert nsm.exists() and nsm.module_exists() and len(nsm.children()) >= 1 # assure we pull locally only nsmc = nsm.children()[0] nsmc.config_writer().set_value('url', async_url) rm.update(recursive=True, progress=prog, dry_run=True) # just to run the code rm.update(recursive=True, progress=prog) - assert len(nsm.children()) == 1 and nsmc.module_exists() + assert len(nsm.children()) >= 2 and nsmc.module_exists() |
