from paste.fixture import TestApp from test_cherrypy import test_app from cherrypaste.pastify import make_app def test_script_name(): # Just a normal request: test_app.get('/') # This should fail, because SCRIPT_NAME='' and PATH_INFO='/foo' test_app.get('/foo', status=404) # This shouldn't fail, because SCRIPT_NAME='/foo' and PATH_INFO='/' test_app.get('/', extra_environ={'SCRIPT_NAME': '/foo'})