Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
586:59268b4d8c71 | 587:d4a01a023998 |
---|---|
1 import os.path | |
2 from foodtruck.config import FoodTruckConfig | |
3 | |
4 | |
5 default_config = os.path.join( | |
6 os.path.dirname(__file__), | |
7 '..', | |
8 'foodtruck', | |
9 'foodtruck.cfg.defaults') | |
10 | |
11 | |
12 def test_getcomplex_option(): | |
13 cstr = '''[foo] | |
14 bar.name = My bar | |
15 bar.path = /path/to/bar | |
16 ''' | |
17 c = FoodTruckConfig(None, None) | |
18 c.load_from_string(cstr) | |
19 expected = {'name': "My bar", 'path': '/path/to/bar'} | |
20 assert c.getcomplex('foo', 'bar') == expected | |
21 |