summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-17 09:31:47 +0200
committerFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-17 09:31:47 +0200
commit07818f75e913b3f26aa719f6ef1b8b501d4b4c84 (patch)
tree359d13c5a0a7fbc653f8b435f0f922ea9232bdad /test
parent26297c83f2232d7e97f8114a97e8188ee3b943ab (diff)
downloadlogilab-common-07818f75e913b3f26aa719f6ef1b8b501d4b4c84.tar.gz
add new test in configuration : trying to find the error discribed in ticket #4993
Diffstat (limited to 'test')
-rw-r--r--test/unittest_configuration.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py
index 4de3c6c..9ca3bec 100644
--- a/test/unittest_configuration.py
+++ b/test/unittest_configuration.py
@@ -86,11 +86,11 @@ class ConfigurationTC(TestCase):
self.assertEquals(cfg['value'], None)
self.assertEquals(cfg['multiple-choice'], ('yo', 'ya'))
- def test_generate_config(self):
- file = os.tmpfile()
- stream = StringIO()
- self.cfg.generate_config(stream)
- self.assertLinesEquals(stream.getvalue().strip(), """# test configuration
+ def test_load_configuration_file_case_insensitive(self):
+ file = tempfile.mktemp()
+ stream = open(file, 'w')
+ try:
+ stream.write("""# test configuration
[Test]
dothis=yes
@@ -109,6 +109,16 @@ multiple-choice=yo,ye
named=key:val
""")
+ self.cfg.load_file_configuration(file)
+ self.assertEquals(self.cfg['dothis'], True)
+ self.assertEquals(self.cfg['value'], None)
+ self.assertEquals(self.cfg['multiple'], ('yop','yep'))
+ self.assertEquals(self.cfg['number'], 2)
+ self.assertEquals(self.cfg['choice'], 'yo')
+ self.assertEquals(self.cfg['multiple-choice'], ('yo', 'ye'))
+ self.assertEquals(self.cfg['named'], {'key': 'val'})
+ finally:
+ os.remove(file)
def test_generate_config(self):
stream = StringIO()