def test_responder(self): def foo(environ, start_response): return BaseResponse(b'Test') client = Client(wsgi.responder(foo), BaseResponse) response = client.get('/') self.assert_equal(response.status_code, 200) self.assert_equal(response.data, b'Test')
def test_responder(): def foo(environ, start_response): return BaseResponse(b'Test') client = Client(wsgi.responder(foo), BaseResponse) response = client.get('/') assert response.status_code == 200 assert response.data == b'Test'
def test_responder(): def foo(environ, start_response): return Response(b"Test") client = Client(wsgi.responder(foo)) response = client.get("/") assert response.status_code == 200 assert response.data == b"Test"
def test_responder(): """Responder decorator""" def foo(environ, start_response): return BaseResponse('Test') client = Client(responder(foo), BaseResponse) response = client.get('/') assert response.status_code == 200 assert response.data == 'Test'