diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-15 16:49:39 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-15 16:53:15 +0100 |
commit | 508807e59ce9d6c3574d314d502e82238e3e606c (patch) | |
tree | 3ed89ce115e472f629b314a640e67be461b789d0 /git/test/test_submodule.py | |
parent | b259098782c2248f6160d2b36d42672d6925023a (diff) | |
download | gitpython-508807e59ce9d6c3574d314d502e82238e3e606c.tar.gz |
Submodule.add() can now handle absolute module paths in agreement to the doc string.
Previously, it would say it can handle absolute module paths, but didn't
actually do so.
A test-case was improved to check for this case.
Fixes #161
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r-- | git/test/test_submodule.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 524a69bf..75edf6e5 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -586,6 +586,14 @@ class TestSubmodule(TestBase): @with_rw_repo(k_no_subm_tag, bare=False) def test_first_submodule(self, rwrepo): assert len(list(rwrepo.iter_submodules())) == 0 - sm = rwrepo.create_submodule('first', 'submodules/first', rwrepo.git_dir, no_checkout=True) - assert sm.exists() and sm.module_exists() - rwrepo.index.commit("Added submodule") + + for sm_name, sm_path in (('first', 'submodules/first'), + ('second', os.path.join(rwrepo.working_tree_dir, 'submodules/second'))): + sm = rwrepo.create_submodule(sm_name, sm_path, rwrepo.git_dir, no_checkout=True) + assert sm.exists() and sm.module_exists() + rwrepo.index.commit("Added submodule " + sm_name) + # end for each submodule path to add + + self.failUnlessRaises(ValueError, rwrepo.create_submodule, 'fail', os.path.expanduser('~')) + self.failUnlessRaises(ValueError, rwrepo.create_submodule, 'fail-too', + rwrepo.working_tree_dir + os.path.sep) |