diff options
author | Christophe de Vienne <christophe@unlish.com> | 2016-01-11 10:24:32 +0100 |
---|---|---|
committer | Christophe de Vienne <christophe@unlish.com> | 2016-01-11 10:24:32 +0100 |
commit | 0533324e9a9f1dd7ec31c5beb7cd373eff434e38 (patch) | |
tree | 44cf8c83b9aa16fceda85c34c9b828c4ebc4450b /test | |
parent | 26f0436667158ac9ed0b2e5b085158787fd6209b (diff) | |
download | logilab-common-0533324e9a9f1dd7ec31c5beb7cd373eff434e38.tar.gz |
[configuration] Fix multi-line strings handling
Closes #3691182
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_configuration.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py index 2a32653..f59a0e0 100644 --- a/test/unittest_configuration.py +++ b/test/unittest_configuration.py @@ -271,6 +271,50 @@ diffgroup=pouet #opt-b-2=""") + def test_generate_config_with_multiline_string(self): + self.cfg['value'] = 'line1\nline2\nline3' + stream = StringIO() + self.cfg.generate_config(stream) + self.assertMultiLineEqual(stream.getvalue().strip(), """[TEST] + +dothis=yes + +value= + line1 + line2 + line3 + +# you can also document the option +multiple=yop,yep + +# boom +number=2 + +bytes=1KB + +choice=yo + +multiple-choice=yo,ye + +named=key:val + +reset-value= + line1 + line2 + line3 + + +[AGROUP] + +diffgroup=pouet + + +[BGROUP] + +#opt-b-1= + +#opt-b-2=""") + def test_roundtrip(self): cfg = self.cfg |