PageRenderTime 31ms CodeModel.GetById 23ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/web/test_wsgi_application_generator.py

https://bitbucket.org/prologic/circuits/
Python | 23 lines | 14 code | 8 blank | 1 comment | 0 complexity | c3d7cbf0c5bcee41463d19675e30ae6c MD5 | raw file
 1#!/usr/bin/env python
 2
 3from circuits.web import Controller
 4from circuits.web.wsgi import Application
 5
 6from .helpers import urlopen
 7
 8
 9class Root(Controller):
10
11    def index(self):
12        def response():
13            yield "Hello "
14            yield "World!"
15        return response()
16
17application = Application() + Root()
18
19
20def test(webapp):
21    f = urlopen(webapp.server.http.base)
22    s = f.read()
23    assert s == b"Hello World!"