Mercurial > piecrust2
comparison tests/test_serving.py @ 723:606f6d57b5df
routing: Cleanup URL routing and improve page matching.
* Add new types of route parameters for integers (int4, int2, int).
* Remove hard-coded hacks around converting year/month/day values.
* Make the blog post routes use the new typed parameters.
* Fix problems with matching routes with integer parameters when they can
get confused with a sub-page number.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 May 2016 20:19:28 -0700 |
parents | ab5c6a8ae90a |
children |
comparison
equal
deleted
inserted
replaced
722:f0a3af3fbea2 | 723:606f6d57b5df |
---|---|
31 routes.append(m) | 31 routes.append(m) |
32 matching = find_routes(routes, uri) | 32 matching = find_routes(routes, uri) |
33 | 33 |
34 assert len(matching) == len(expected) | 34 assert len(matching) == len(expected) |
35 for i in range(len(matching)): | 35 for i in range(len(matching)): |
36 route, metadata = matching[i] | 36 route, metadata, is_sub_page = matching[i] |
37 exp_source, exp_md = expected[i] | 37 exp_source, exp_md = expected[i] |
38 assert route.source_name == exp_source | 38 assert route.source_name == exp_source |
39 assert metadata == exp_md | 39 assert metadata == exp_md |
40 | 40 |
41 | 41 |