summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-16 15:07:51 +0200
committerFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-16 15:07:51 +0200
commit5293c540df765031ef8747e675c317106aba0c32 (patch)
tree6a9d4282b331c7d0877ce90f7d60026478276e25 /test
parente543924fed0cb07c33403f59f05edfdb59799ca8 (diff)
downloadlogilab-common-5293c540df765031ef8747e675c317106aba0c32.tar.gz
debug testlib color printing due to unexpected stream (cStringIO)
Diffstat (limited to 'test')
-rw-r--r--test/unittest_configuration.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py
index 9d65664..4de3c6c 100644
--- a/test/unittest_configuration.py
+++ b/test/unittest_configuration.py
@@ -85,6 +85,30 @@ class ConfigurationTC(TestCase):
self.assertEquals(cfg['choice'], 'ye')
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
+[Test]
+
+dothis=yes
+
+#value=
+
+# you can also document the option
+multiple=yop,yep
+
+# boom
+number=2
+
+choice=yo
+
+multiple-choice=yo,ye
+
+named=key:val
+""")
def test_generate_config(self):
stream = StringIO()