diff options
author | grabner <pjg.github@ubergrabner.net> | 2014-04-15 21:56:35 -0400 |
---|---|---|
committer | grabner <pjg.github@ubergrabner.net> | 2014-04-15 21:56:35 -0400 |
commit | 6852f2cefc64b4a853ee64ec7159cbd857c8ed41 (patch) | |
tree | 63db81a936c55f81797929c11c04df20918e08cf | |
parent | 81b202e740a9a5acdecc8f099bab3812a1f891ef (diff) | |
download | iniherit-6852f2cefc64b4a853ee64ec7159cbd857c8ed41.tar.gz |
fix for issue #2
-rw-r--r-- | iniherit/cli.py | 1 | ||||
-rw-r--r-- | iniherit/test_cli.py | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/iniherit/cli.py b/iniherit/cli.py index 7dc36a3..14d3abc 100644 --- a/iniherit/cli.py +++ b/iniherit/cli.py @@ -49,6 +49,7 @@ def flatten(input, output, loader=None): else: cfg.readfp(input) out = iniherit.parser.CP.RawConfigParser() + out.optionxform = str cfg._apply(cfg, out) if not isstr(output): out.write(output) diff --git a/iniherit/test_cli.py b/iniherit/test_cli.py new file mode 100644 index 0000000..84df1e3 --- /dev/null +++ b/iniherit/test_cli.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +#------------------------------------------------------------------------------ +# file: $Id$ +# auth: Philip J Grabner <grabner@cadit.com> +# date: 2014/04/15 +# copy: (C) Copyright 2014-EOT Cadit Inc., All Rights Reserved. +#------------------------------------------------------------------------------ + +import unittest +import six + +from .cli import flatten + +#------------------------------------------------------------------------------ +class TestIniheritCli(unittest.TestCase): + + #---------------------------------------------------------------------------- + def test_optionKeyCaseStaysConstant(self): + src = '''\ +[app] +someURL = http://example.com/PATH + +''' + + buf = six.StringIO() + flatten(six.StringIO(src), buf) + out = buf.getvalue() + + self.assertMultiLineEqual(out, src) + +#------------------------------------------------------------------------------ +# end of $Id$ +#------------------------------------------------------------------------------ |