Esempio n. 1
0
 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')
Esempio n. 2
0
 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')
Esempio n. 3
0
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'
Esempio n. 4
0
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'
Esempio n. 5
0
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"
Esempio n. 6
0
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'
Esempio n. 7
0
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'