def test_wsgi_app_caller():
    caller = wsgi_app_caller.WSGIAppCaller(demo_app)
    environ = dict(BASE_ENVIRON)
    input_data = 'some text'
    responses, status, headers = caller.handle(environ, input_data)
    response = ''.join(responses)

    assert status == '200 OK'
    assert headers == [('Content-Type', 'text/plain')]
    assert response.startswith(
        'Old school write method\n***********************\n')
    assert 'Hello World!\n' in response
    assert 'foo.var=bla\n' in response
    assert 'input_data=%s\n' % input_data in response
Exemplo n.º 2
0
    def handle(self, environ, input_data, *args, **kwargs):
        app = wsgi_app_caller.WSGIAppCaller(
            create_echo_wsgi_app(*args, **kwargs))

        return app.handle(environ, input_data)