diff options
author | Michael Wayne Goodman <goodman.m.w@gmail.com> | 2015-07-24 17:54:33 +0800 |
---|---|---|
committer | Michael Wayne Goodman <goodman.m.w@gmail.com> | 2015-07-24 17:54:33 +0800 |
commit | 3991f265f5b1a24bed7f05725c14f1e02760c328 (patch) | |
tree | 46d4e82d2136a2add8e3b3511ad6fcb9d60e6269 /test/test_config.py | |
parent | 85328fc09cb99c8afc5eba1ce2f5c833cc2742b0 (diff) | |
download | bottle-3991f265f5b1a24bed7f05725c14f1e02760c328.tar.gz |
Fix #720 : Allow unicode keys in ConfigDict.
Diffstat (limited to 'test/test_config.py')
-rw-r--r-- | test/test_config.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_config.py b/test/test_config.py index e953f84..a4cfd9f 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -58,6 +58,17 @@ class TestConfDict(unittest.TestCase): self.assertEqual(c['a.b.foo'], 5) self.assertEqual(c['a.b.bar'], 6) self.assertEqual(c['a.baz'], 7) + # unicode keys (see issue #720) + try: + key = unichr(12354) + except NameError: + key = chr(12354) + c = ConfigDict() + c.load_dict({key: 'value'}) + self.assertEqual('value', c[key]) + c = ConfigDict() + c.load_dict({key: {'subkey': 'value'}}) + self.assertEqual('value', c[key + '.subkey']) if __name__ == '__main__': #pragma: no cover unittest.main() |