diff foodtruckui/tests/test_config.py @ 587:d4a01a023998

admin: Add "FoodTruck" admin panel from the side experiment project.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Jan 2016 14:24:35 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/foodtruckui/tests/test_config.py	Sat Jan 16 14:24:35 2016 -0800
@@ -0,0 +1,21 @@
+import os.path
+from foodtruck.config import FoodTruckConfig
+
+
+default_config = os.path.join(
+        os.path.dirname(__file__),
+        '..',
+        'foodtruck',
+        'foodtruck.cfg.defaults')
+
+
+def test_getcomplex_option():
+    cstr = '''[foo]
+    bar.name = My bar
+    bar.path = /path/to/bar
+    '''
+    c = FoodTruckConfig(None, None)
+    c.load_from_string(cstr)
+    expected = {'name': "My bar", 'path': '/path/to/bar'}
+    assert c.getcomplex('foo', 'bar') == expected
+