Esempio n. 1
0
def test_registered_handler_should_work_as_a_normal_url_handler():
    @handlers.register(r'/test/dummy-url')
    class DummyHandler(tornado.web.RequestHandler):
        def get(self):
            self.write("Dummy handler")
    
    resp = requests.get(build_root_url('/test/dummy-url'))

    assert 200 == resp.status_code
    assert "Dummy handler" == resp.content
Esempio n. 2
0
def test_should_return_500_for_error():
    resp = requests.get(build_root_url('/test/faulty-url'))
    assert 500 == resp.status_code