私はCPython 2.7でトルネード4.4を使用しています。トルネードのhello_worldテストは599を返します
http://www.tornadoweb.org/en/stable/guide/structure.htmlからimport tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app = make_app()
app.listen(8888)
tornado.ioloop.IOLoop.current().start()
はその後hello.pyのとする:
は私がコピーされたhttp://www.tornadoweb.org/en/stable/testing.htmlから
import hello
class TestHelloApp(AsyncHTTPTestCase):
def get_app(self):
return hello.make_app()
def test_homepage(self):
response = self.fetch('/')
self.assertEqual(response.code, 200)
self.assertEqual(response.body, 'Hello, world')
が
をtest_hello.pyすると私は実行すると:
python -m tornado.test.runtests test_hello
取得中:
AssertionError: 599 != 200
です。
何かが見つからないか、Tornadoのドキュメント/コードを更新する必要があります。
私の悪い、それを指摘してくれてありがとうJessie。私はまだ599を得ています。 – pdx9