summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrabner <pjg.github@ubergrabner.net>2014-04-15 21:56:35 -0400
committergrabner <pjg.github@ubergrabner.net>2014-04-15 21:56:35 -0400
commit6852f2cefc64b4a853ee64ec7159cbd857c8ed41 (patch)
tree63db81a936c55f81797929c11c04df20918e08cf
parent81b202e740a9a5acdecc8f099bab3812a1f891ef (diff)
downloadiniherit-6852f2cefc64b4a853ee64ec7159cbd857c8ed41.tar.gz
fix for issue #2
-rw-r--r--iniherit/cli.py1
-rw-r--r--iniherit/test_cli.py33
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$
+#------------------------------------------------------------------------------