From 6ecdbc409d2109a9e7fc5367c64067f0400f07cc Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 22 Jun 2009 00:12:45 +0000 Subject: - Adding ``*path_info`` to a route no longer changes the PATH_INFO for a request that matches using URL dispatch. This feature was only there to service the ``repoze.bfg.wsgi.wsgiapp2`` decorator and it did it wrong; use ``*subpath`` instead now. - The interface generation performed for named request factories had the wrong base classes. --- repoze/bfg/tests/test_urldispatch.py | 48 ------------------------------------ 1 file changed, 48 deletions(-) (limited to 'repoze/bfg/tests/test_urldispatch.py') diff --git a/repoze/bfg/tests/test_urldispatch.py b/repoze/bfg/tests/test_urldispatch.py index eb3be4323..68fda032d 100644 --- a/repoze/bfg/tests/test_urldispatch.py +++ b/repoze/bfg/tests/test_urldispatch.py @@ -70,54 +70,6 @@ class RoutesRootFactoryTests(unittest.TestCase): self.assertEqual(environ['bfg.routes.matchdict'], {}) self.assertEqual(environ['wsgiorg.routing_args'], ((), {})) - def test_matches_with_path_info_no_scriptname(self): - root_factory = make_get_root(123) - mapper = self._makeOne(root_factory) - mapper.connect('root', '/a/b/*path_info') - environ = self._getEnviron(PATH_INFO='/a/b/c/d') - result = mapper(environ) - self.assertEqual(result, 123) - self.assertEqual(environ['bfg.routes.route'].name, 'root') - self.assertEqual(environ['bfg.routes.matchdict'], {'path_info':'c/d'}) - self.assertEqual(environ['PATH_INFO'], '/c/d') - self.assertEqual(environ['SCRIPT_NAME'], '/a/b') - - def test_matches_with_path_info_with_scriptname(self): - root_factory = make_get_root(123) - mapper = self._makeOne(root_factory) - mapper.connect('root', '/a/b/*path_info') - environ = self._getEnviron(PATH_INFO='/a/b/c/d', SCRIPT_NAME='z') - result = mapper(environ) - self.assertEqual(result, 123) - self.assertEqual(environ['bfg.routes.route'].name, 'root') - self.assertEqual(environ['bfg.routes.matchdict'], {'path_info':'c/d'}) - self.assertEqual(environ['PATH_INFO'], '/c/d') - self.assertEqual(environ['SCRIPT_NAME'], 'z/a/b') - - def test_matches_PATH_INFO_w_extra_slash(self): - root_factory = make_get_root(123) - mapper = self._makeOne(root_factory) - mapper.connect('root', '/a/b/*path_info') - environ = self._getEnviron(PATH_INFO='/a/b//c/d', SCRIPT_NAME='') - result = mapper(environ) - self.assertEqual(result, 123) - self.assertEqual(environ['bfg.routes.route'].name, 'root') - self.assertEqual(environ['bfg.routes.matchdict'], {'path_info':'/c/d'}) - self.assertEqual(environ['PATH_INFO'], '/c/d') - self.assertEqual(environ['SCRIPT_NAME'], '/a/b') - - def test_matches_SCRIPT_NAME_endswith_slash(self): - root_factory = make_get_root(123) - mapper = self._makeOne(root_factory) - mapper.connect('root', '/a/b//*path_info') - environ = self._getEnviron(PATH_INFO='/a/b//c/d', SCRIPT_NAME='') - result = mapper(environ) - self.assertEqual(result, 123) - self.assertEqual(environ['bfg.routes.route'].name, 'root') - self.assertEqual(environ['bfg.routes.matchdict'], {'path_info':'c/d'}) - self.assertEqual(environ['PATH_INFO'], '/c/d') - self.assertEqual(environ['SCRIPT_NAME'], '/a/b') - def test_unicode_in_route_default(self): root_factory = make_get_root(123) mapper = self._makeOne(root_factory) -- cgit v1.2.3