summaryrefslogtreecommitdiff
path: root/git/test/test_config.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-19 16:57:11 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-19 16:57:11 +0100
commit20863cfe4a1b0c5bea18677470a969073570e41c (patch)
tree3e64226fb902a4558ba1765f7f4fa6d4cc8a2524 /git/test/test_config.py
parenta223c7b7730c53c3fa1e4c019bd3daefbb8fd74b (diff)
downloadgitpython-20863cfe4a1b0c5bea18677470a969073570e41c.tar.gz
Implemented Submodule.rename()
A test verifies it's truly working. Related to #238
Diffstat (limited to 'git/test/test_config.py')
-rw-r--r--git/test/test_config.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/git/test/test_config.py b/git/test/test_config.py
index 9a44d9e3..286d151e 100644
--- a/git/test/test_config.py
+++ b/git/test/test_config.py
@@ -193,3 +193,16 @@ class TestBase(TestCase):
cr = GitConfigParser(fpa, read_only=True)
check_test_value(cr, tv)
cr.release()
+
+ def test_rename(self):
+ file_obj = self._to_memcache(fixture_path('git_config'))
+ cw = GitConfigParser(file_obj, read_only=False, merge_includes=False)
+
+ self.failUnlessRaises(ValueError, cw.rename_section, "doesntexist", "foo")
+ self.failUnlessRaises(ValueError, cw.rename_section, "core", "include")
+
+ nn = "bee"
+ assert cw.rename_section('core', nn) is cw
+ assert not cw.has_section('core')
+ assert len(cw.items(nn)) == 4
+ cw.release()