Skip to content

Instantly share code, notes, and snippets.

@oddskool
oddskool / gen.engine async fetch testing
Created February 3, 2012 14:35
Sample test case for a Tornado WS that asynchronously calls a third-party WS
from tornado import ioloop , gen
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from tornado.web import asynchronous, RequestHandler, Application
from tornado.testing import AsyncHTTPTestCase
import sys
from tornado.ioloop import IOLoop
class MainHandler(RequestHandler):
url = u'http://www.google.com'
@asynchronous
@gen.engine