Mercurial > piecrust2
diff tests/test_sources_autoconfig.py @ 363:dd25bd3ce1f9
serve: Refactoring and fixes to be able to serve taxonomy pages.
* Page sources' `findPagePath` is renamed to `findPageFactory`, so that it
also returns source metadata.
* Page refs now store possible hits more properly, and use the previous point
to also store metadata. As a result, they can also return a proper factory.
* Implement `findPageFactory` correctly in all built-in sources.
* When the Chef server matches a taxonomy page, get the source metadata from
the page ref in order to make a more proper page.
* Make the `getRoute(s)` functions explicitely say if they want taxonomy routes
or not.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 26 Apr 2015 15:07:40 -0700 |
parents | a2d283d1033d |
children | e7b865f8f335 |
line wrap: on
line diff
--- a/tests/test_sources_autoconfig.py Sun Apr 26 08:34:27 2015 -0700 +++ b/tests/test_sources_autoconfig.py Sun Apr 26 15:07:40 2015 -0700 @@ -173,7 +173,10 @@ app = fs.getApp() s = app.getSource('test') route_metadata = {'slug': route_path} - fac_path, metadata = s.findPagePath(route_metadata, MODE_PARSING) - assert fac_path == slashfix(expected_path) - assert metadata == expected_metadata + factory = s.findPageFactory(route_metadata, MODE_PARSING) + if factory is None: + assert expected_path is None and expected_metadata is None + return + assert factory.rel_path == slashfix(expected_path) + assert factory.metadata == expected_metadata