diff options
author | fuzzyman <devnull@localhost> | 2009-12-13 22:37:46 +0000 |
---|---|---|
committer | fuzzyman <devnull@localhost> | 2009-12-13 22:37:46 +0000 |
commit | 664df64c7d3dae37de86bc2af0a9a55180fbe5d7 (patch) | |
tree | 7d256d22d9b87b9c6f832b7d0f297a7c571e6b91 | |
parent | f888ca21680e74a06544ec4ad4a6b9b19c0a8f51 (diff) | |
download | configobj-664df64c7d3dae37de86bc2af0a9a55180fbe5d7.tar.gz |
Adding failing test.
-rw-r--r-- | functionaltests/test_configobj.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/functionaltests/test_configobj.py b/functionaltests/test_configobj.py new file mode 100644 index 0000000..6ecfec2 --- /dev/null +++ b/functionaltests/test_configobj.py @@ -0,0 +1,26 @@ +import os +import unittest +from configobj import ConfigObj + +class TestConfigObj(unittest.TestCase): + + def test_order_preserved(self): + c = ConfigObj() + c['a'] = 1 + c['b'] = 2 + c['c'] = 3 + c['section'] = {} + c['section']['a'] = 1 + c['section']['b'] = 2 + c['section']['c'] = 3 + c['section']['section'] = {} + c['section']['section2'] = {} + c['section']['section3'] = {} + c['section2'] = {} + c['section3'] = {} + + c2 = ConfigObj(c) + self.assertEqual(c2.scalars, ['a', 'b', 'c']) + self.assertEqual(c2.sections, ['section', 'section2', 'section3']) + self.assertEqual(c2['section'].scalars, ['a', 'b', 'c']) + self.assertEqual(c2['section'].c.sections, ['section', 'section2', 'section3'])
\ No newline at end of file |