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

/tests/web/test_generator.py

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