From 7ae36c3e019a5cc16924d1b6007774bfb625036f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 6 May 2011 18:53:59 +0200 Subject: Started to fix imports - tests still have no chance to work as database changed drastically. Now the actual work begins --- git/test/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/test/test_config.py') diff --git a/git/test/test_config.py b/git/test/test_config.py index 173e380c..b163b0af 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -4,7 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from git.test.lib import * +from git.test.lib import TestBase from git import * import StringIO from copy import copy -- cgit v1.2.3 From 6f960586feccff8c1f2c717765eb0a5e8b9cd6f3 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 30 May 2011 21:14:22 +0200 Subject: Fixed remaining tests as good as possible. remote/fetch/pull and submodule tests need some more work. Also, the tests need to be reorganized and move closer to their actual location within gitpython. Hence the refs tests go to git.test.refs, etc --- git/test/test_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git/test/test_config.py') diff --git a/git/test/test_config.py b/git/test/test_config.py index b163b0af..d07fe6fd 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -4,13 +4,13 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from git.test.lib import TestBase -from git import * +from git.test.lib import TestBase, fixture_path import StringIO +from git.config import * from copy import copy from ConfigParser import NoSectionError -class TestBase(TestCase): +class TestConfig(TestBase): def _to_memcache(self, file_path): fp = open(file_path, "r") -- cgit v1.2.3 From ba825ea244c70d342e0098b4ab4f62507be70f12 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 7 Jun 2011 19:58:06 +0200 Subject: Greatly improved robustness of config parser - it can now take pretty much everything. Includes an updated config file which includes all the new additions --- git/test/test_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'git/test/test_config.py') diff --git a/git/test/test_config.py b/git/test/test_config.py index d07fe6fd..d2e199e3 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -30,7 +30,9 @@ class TestConfig(TestBase): w_config.read() # enforce reading assert w_config._sections w_config.write() # enforce writing - assert file_obj.getvalue() == file_obj_orig.getvalue() + + # we stripped lines when reading, so the results differ + assert file_obj.getvalue() != file_obj_orig.getvalue() # creating an additional config writer must fail due to exclusive access self.failUnlessRaises(IOError, GitConfigParser, file_obj, read_only = False) @@ -56,10 +58,10 @@ class TestConfig(TestBase): file_obj.seek(0) r_config = GitConfigParser(file_obj, read_only=True) + #print file_obj.getvalue() assert r_config.has_section(sname) assert r_config.has_option(sname, oname) assert r_config.get(sname, oname) == val - # END for each filename def test_base(self): -- cgit v1.2.3