def test_cgi_root_fix_custom_app_root(self): app = fixers.CGIRootFix(path_check_app, app_root='/baz/poop/') response = Response.from_app(app, dict(create_environ(), SCRIPT_NAME='/foo', PATH_INFO='/bar' )) self.assert_equal(response.get_data(), b'PATH_INFO: /foo/bar\nSCRIPT_NAME: baz/poop')
def test_cgi_root_fix(self): app = fixers.CGIRootFix(path_check_app) response = Response.from_app(app, dict(create_environ(), SCRIPT_NAME='/foo', PATH_INFO='/bar', SERVER_SOFTWARE='lighttpd/1.4.27' )) assert response.data == b'PATH_INFO: /foo/bar\nSCRIPT_NAME: '
def test_cgi_root_fix_custom_app_root(self): app = fixers.CGIRootFix(path_check_app, app_root="/baz/") response = Response.from_app( app, dict(create_environ(), SCRIPT_NAME="/foo", PATH_INFO="/bar")) assert response.get_data() == b"PATH_INFO: /bar\nSCRIPT_NAME: baz"
def test_cgi_root_fix(self): app = fixers.CGIRootFix(path_check_app) response = Response.from_app( app, dict(create_environ(), SCRIPT_NAME='/foo', PATH_INFO='/bar')) assert response.get_data() == b'PATH_INFO: /bar\nSCRIPT_NAME: '