/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
- #!/usr/bin/env python
- from circuits.web import Controller
- from circuits.web.wsgi import Application
- from .helpers import urlopen
- class Root(Controller):
- def index(self):
- def response():
- yield "Hello "
- yield "World!"
- return response()
- application = Application() + Root()
- def test(webapp):
- f = urlopen(webapp.server.http.base)
- s = f.read()
- assert s == b"Hello World!"