Beispiel #1
0
def test_WSGIHTTPException_call_w_body():
    def start_response(status, headers, exc_info=None):
        pass

    environ = {"wsgi.url_scheme": "HTTP", "SERVER_NAME": "localhost", "SERVER_PORT": "80", "REQUEST_METHOD": "PUT"}
    excep = WSGIHTTPException()
    excep.body = "test"
    assert_equal(excep(environ, start_response), ["test"])
Beispiel #2
0
def test_WSGIHTTPException_call_w_body():
    def start_response(status, headers, exc_info=None):
        pass
    environ = {
       'wsgi.url_scheme': 'HTTP',
       'SERVER_NAME': 'localhost',
       'SERVER_PORT': '80',
       'REQUEST_METHOD': 'PUT'
    }
    excep = WSGIHTTPException()
    excep.body = b'test'
    assert_equal( excep(environ,start_response), [b'test'] )