예제 #1
0
파일: fixers.py 프로젝트: fhelmli/homeNOWG2
 def test_path_info_from_request_uri_fix(self):
     app = fixers.PathInfoFromRequestUriFix(path_check_app)
     for key in 'REQUEST_URI', 'REQUEST_URL', 'UNENCODED_URL':
         env = dict(create_environ(), SCRIPT_NAME='/test', PATH_INFO='/?????')
         env[key] = '/test/foo%25bar?drop=this'
         response = Response.from_app(app, env)
         self.assert_equal(response.get_data(), b'PATH_INFO: /foo%bar\nSCRIPT_NAME: /test')
def test_path_info_from_request_uri_fix():
    """Test the PathInfoFromRequestUriFix fixer"""
    app = fixers.PathInfoFromRequestUriFix(path_check_app)
    for key in 'REQUEST_URI', 'REQUEST_URL', 'UNENCODED_URL':
        env = dict(create_environ(), SCRIPT_NAME='/test', PATH_INFO='/?????')
        env[key] = '/test/foo%25bar?drop=this'
        response = Response.from_app(app, env)
        assert response.data == 'PATH_INFO: /foo%bar\nSCRIPT_NAME: /test'
예제 #3
0
 def test_path_info_from_request_uri_fix(self):
     app = fixers.PathInfoFromRequestUriFix(path_check_app)
     for key in "REQUEST_URI", "REQUEST_URL", "UNENCODED_URL":
         env = dict(create_environ(),
                    SCRIPT_NAME="/test",
                    PATH_INFO="/?????")
         env[key] = "/test/foo%25bar?drop=this"
         response = Response.from_app(app, env)
         assert response.get_data(
         ) == b"PATH_INFO: /foo%bar\nSCRIPT_NAME: /test"