From: Ben Darnell Date: Fri, 30 Jul 2010 21:21:37 +0000 (-0700) Subject: Docstring updates X-Git-Tag: v1.1.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=252cb1c00b999e05b0f0041829bdbbf9905b6617;p=thirdparty%2Ftornado.git Docstring updates --- diff --git a/tornado/testing.py b/tornado/testing.py index d8b84c612..b810edf26 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -134,6 +134,13 @@ class AsyncTestCase(unittest.TestCase): self.__stopped = True def wait(self, condition=None, timeout=5): + """Runs the IOLoop until stop is called or timeout has passed. + + In the event of a timeout, an exception will be thrown. + + If condition is not None, the IOLoop will be restarted after stop() + until condition() returns true. + """ if not self.__stopped: if timeout: def timeout_func(): @@ -194,12 +201,16 @@ class AsyncHTTPTestCase(AsyncTestCase): self.http_server.listen(self.get_http_port()) def get_app(self): - ''' - @rtype L{tornado.web.Application} - ''' + """Should be overridden by subclasses to return a + tornado.web.Application or other HTTPServer callback. + """ raise NotImplementedError() def get_http_port(self): + """Returns the port used by the HTTPServer. + + A new port is chosen for each test. + """ if self.__port is not None: return self.__port self.__port = AsyncHTTPTestCase.__next_port @@ -207,6 +218,7 @@ class AsyncHTTPTestCase(AsyncTestCase): return self.__port def get_url(self, path): + """Returns an absolute url for the given path on the test server.""" return 'http://localhost:%s%s' % (self.get_http_port(), path) def tearDown(self):