Пример #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')
Пример #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')
Пример #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'
Пример #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'
Пример #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"
Пример #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'
Пример #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'