Mercurial > piecrust2
comparison tests/test_appconfig.py @ 585:25df894f9ab9
internal: Some fixes to the new app configuration.
* Tweak order of source registration.
* Add some missing default settings.
* Fix some validation code.
* Add better error handling to validation.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 02 Jan 2016 16:39:26 -0800 |
parents | 9ccc933ac2c7 |
children | 3df808b133f8 |
comparison
equal
deleted
inserted
replaced
584:9ccc933ac2c7 | 585:25df894f9ab9 |
---|---|
27 'routes': [{'url': '/notes/%path:slug%', 'source': 'notes'}] | 27 'routes': [{'url': '/notes/%path:slug%', 'source': 'notes'}] |
28 }} | 28 }} |
29 config = PieCrustConfiguration(values=values) | 29 config = PieCrustConfiguration(values=values) |
30 # The order of routes is important. Sources, not so much. | 30 # The order of routes is important. Sources, not so much. |
31 assert list(map(lambda v: v['source'], config.get('site/routes'))) == [ | 31 assert list(map(lambda v: v['source'], config.get('site/routes'))) == [ |
32 'notes', 'pages', 'posts', 'posts', 'posts', 'theme_pages'] | 32 'notes', 'posts', 'posts', 'posts', 'pages', 'theme_pages'] |
33 assert list(config.get('site/sources').keys()) == [ | 33 assert list(config.get('site/sources').keys()) == [ |
34 'posts', 'pages', 'notes', 'theme_pages'] | 34 'pages', 'posts', 'notes', 'theme_pages'] |
35 | 35 |