PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/web/test_wsgi_gateway_generator.py

https://bitbucket.org/prologic/circuits/
Python | 21 lines | 13 code | 7 blank | 1 comment | 0 complexity | c94482dd3ff8a6b1cce8fab602a33247 MD5 | raw file
 1#!/usr/bin/env python
 2
 3from .helpers import urlopen
 4
 5
 6def application(environ, start_response):
 7    status = "200 OK"
 8    response_headers = [("Content-type", "text/plain")]
 9    start_response(status, response_headers)
10
11    def response():
12        yield "Hello "
13        yield "World!"
14
15    return response()
16
17
18def test(webapp):
19    f = urlopen(webapp.server.http.base)
20    s = f.read()
21    assert s == b"Hello World!"