diff tests/test_uriutil.py @ 329:422052d2e978

internal: Try handling URLs in a consistent way. * Now URLs passed to, and returned from, routes will always be absolute URLs, i.e. URLs including the site root. * Validate the site root at config loading time to make sure it starts and ends with a slash. * Get rid of unused stuff. * Add tests.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 31 Mar 2015 23:03:28 -0700
parents eb958151c8dc
children d4321317beae
line wrap: on
line diff
--- a/tests/test_uriutil.py	Tue Mar 31 22:38:56 2015 -0700
+++ b/tests/test_uriutil.py	Tue Mar 31 23:03:28 2015 -0700
@@ -39,8 +39,9 @@
 def test_split_sub_uri(uri, expected, pretty_urls):
     app = mock.MagicMock()
     app.config = {
+            'site/root': '/whatever/',
             'site/pretty_urls': pretty_urls,
             '__cache/pagination_suffix_re': '/(?P<num>\\d+)$'}
-    actual = split_sub_uri(app, uri)
-    assert actual == expected
+    actual = split_sub_uri(app, '/whatever/' + uri)
+    assert actual == ('/whatever/' + expected[0], expected[1])