Skip to content

Instantly share code, notes, and snippets.

@paolo-losi
Created November 17, 2010 10:48
Show Gist options
  • Save paolo-losi/703250 to your computer and use it in GitHub Desktop.
Save paolo-losi/703250 to your computer and use it in GitHub Desktop.
tornado async test
class TestConnectionHandshake(testing.AsyncTestCase):
def test_handshake(self):
conn = Connection('localhost', io_loop=self.io_loop)
def on_connect():
self.assertEquals(conn.status, status.CONNECTED)
conn.close(self.stop)
conn.connect(on_connect)
self.wait()
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment