]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Run latest autopep8
authorBen Darnell <ben@bendarnell.com>
Wed, 30 Sep 2015 03:57:38 +0000 (23:57 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 30 Sep 2015 03:57:38 +0000 (23:57 -0400)
tornado/iostream.py
tornado/test/auth_test.py
tornado/test/gen_test.py
tornado/test/httpserver_test.py
tornado/test/httputil_test.py
tornado/test/ioloop_test.py
tornado/test/simple_httpclient_test.py
tornado/test/tcpserver_test.py
tornado/test/template_test.py
tornado/test/web_test.py

index 0bad0acd6e70dd78a7c1e6aad42ed47b625a0f6c..4e304f890073e19f8da8264c9dd10e126e0c2b35 100644 (file)
@@ -1282,7 +1282,7 @@ class SSLIOStream(IOStream):
             # those errors quiet as well.
             # https://groups.google.com/forum/?fromgroups#!topic/python-tornado/ApucKJat1_0
             if (self._is_connreset(err) or
-                err.args[0] in (errno.EBADF, errno.ENOTCONN)):
+                    err.args[0] in (errno.EBADF, errno.ENOTCONN)):
                 return self.close(exc_info=True)
             raise
         except AttributeError:
index 3ed40e45b3315f2b1bdf0d6856237253b021fe5c..59c96b232ff03844b7280daa17de82d74b302ee9 100644 (file)
@@ -142,10 +142,10 @@ class FacebookClientLoginHandler(RequestHandler, FacebookGraphMixin):
                 code=self.get_argument("code"))
             self.write(user)
         else:
-                yield self.authorize_redirect(
-                    redirect_uri=self.request.full_url(),
-                    client_id=self.settings["facebook_api_key"],
-                    extra_params={"scope": "read_stream,offline_access"})
+            yield self.authorize_redirect(
+                redirect_uri=self.request.full_url(),
+                client_id=self.settings["facebook_api_key"],
+                extra_params={"scope": "read_stream,offline_access"})
 
 
 class FacebookServerAccessTokenHandler(RequestHandler):
@@ -514,9 +514,9 @@ class GoogleOAuth2UserinfoHandler(RequestHandler):
         assert self.get_argument('access_token') == 'fake-access-token'
         # return a fake user
         self.finish({
-                'name': 'Foo',
-                'email': 'foo@example.com'
-                })
+            'name': 'Foo',
+            'email': 'foo@example.com'
+        })
 
 
 class GoogleOAuth2Test(AsyncHTTPTestCase):
index d37e093651556e5f6343cbf945d79b31b0e33625..744dc4046f7c50da22485a7ab267f30a7dbd19c4 100644 (file)
@@ -411,9 +411,9 @@ class GenEngineTest(AsyncTestCase):
 
         # Exception logging may be explicitly quieted.
         with self.assertRaises(RuntimeError):
-                yield gen.Multi([self.async_exception(RuntimeError("error 1")),
-                                 self.async_exception(RuntimeError("error 2"))],
-                                quiet_exceptions=RuntimeError)
+            yield gen.Multi([self.async_exception(RuntimeError("error 1")),
+                             self.async_exception(RuntimeError("error 2"))],
+                            quiet_exceptions=RuntimeError)
 
     @gen_test
     def test_multi_future_exceptions(self):
@@ -430,10 +430,10 @@ class GenEngineTest(AsyncTestCase):
 
         # Exception logging may be explicitly quieted.
         with self.assertRaises(RuntimeError):
-                yield gen.multi_future(
-                    [self.async_exception(RuntimeError("error 1")),
-                     self.async_exception(RuntimeError("error 2"))],
-                    quiet_exceptions=RuntimeError)
+            yield gen.multi_future(
+                [self.async_exception(RuntimeError("error 1")),
+                 self.async_exception(RuntimeError("error 2"))],
+                quiet_exceptions=RuntimeError)
 
     def test_arguments(self):
         @gen.engine
@@ -938,6 +938,7 @@ class GenCoroutineTest(AsyncTestCase):
 
         self.finished = True
 
+
 class GenSequenceHandler(RequestHandler):
     @asynchronous
     @gen.engine
@@ -1324,7 +1325,6 @@ class WaitIteratorTest(AsyncTestCase):
         yield namespace['f']()
         self.assertTrue(self.finished)
 
-
     @gen_test
     def test_no_ref(self):
         # In this usage, there is no direct hard reference to the
index b445032afc8285c8d194c3b70446387a8aa02ccf..859d817d0d92269edc89dcb8e05314417ba31ef3 100644 (file)
@@ -177,12 +177,12 @@ class BadSSLOptionsTest(unittest.TestCase):
         self.assertRaises((ValueError, IOError),
                           HTTPServer, application, ssl_options={
                               "certfile": "/__mising__.crt",
-                          })
+        })
         self.assertRaises((ValueError, IOError),
                           HTTPServer, application, ssl_options={
                               "certfile": existing_certificate,
                               "keyfile": "/__missing__.key"
-                          })
+        })
 
         # This actually works because both files exist
         HTTPServer(application, ssl_options={
index b74fdcbf1404305e6a5345e7ca71a13c33cb2fc0..3f25f3eedae45a8a7be418262622f2ac81bf67a2 100644 (file)
@@ -319,6 +319,7 @@ Foo: even
         self.assertEqual(headers['quux'], 'xyzzy')
         self.assertEqual(sorted(headers.get_all()), [('Foo', 'bar'), ('Quux', 'xyzzy')])
 
+
 class FormatTimestampTest(unittest.TestCase):
     # Make sure that all the input types are supported.
     TIMESTAMP = 1359312200.503611
index c914b1c74bfb2226e1aee17ce28c587bd0d7b2b6..0711282e327b34c4007e8594774ba6e91bebe41b 100644 (file)
@@ -441,7 +441,6 @@ class TestIOLoopCurrent(unittest.TestCase):
             # Now that the loop is stopped, it is no longer current.
             self.assertIsNone(IOLoop.current(instance=False))
 
-
     def test_force_current(self):
         self.io_loop = IOLoop(make_current=True)
         self.assertIs(self.io_loop, IOLoop.current())
index 5214c1e45d3597626168404a0f9edc8bf303504a..d478071f318f9202e9bf5e421a3a9944229b0a24 100644 (file)
@@ -107,7 +107,7 @@ class NoContentLengthHandler(RequestHandler):
             # level so we have to go around it.
             stream = self.request.connection.detach()
             stream.write(b"HTTP/1.0 200 OK\r\n\r\n"
-                               b"hello")
+                         b"hello")
             stream.close()
         else:
             self.finish('HTTP/1 required')
@@ -668,22 +668,22 @@ class MaxBodySizeTest(AsyncHTTPTestCase):
     def get_app(self):
         class SmallBody(RequestHandler):
             def get(self):
-                self.write("a"*1024*64)
+                self.write("a" * 1024 * 64)
 
         class LargeBody(RequestHandler):
             def get(self):
-                self.write("a"*1024*100)
+                self.write("a" * 1024 * 100)
 
         return Application([('/small', SmallBody),
                             ('/large', LargeBody)])
 
     def get_http_client(self):
-        return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024*64)
+        return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024 * 64)
 
     def test_small_body(self):
         response = self.fetch('/small')
         response.rethrow()
-        self.assertEqual(response.body, b'a'*1024*64)
+        self.assertEqual(response.body, b'a' * 1024 * 64)
 
     def test_large_body(self):
         with ExpectLog(gen_log, "Malformed HTTP message from None: Content-Length too long"):
@@ -696,15 +696,15 @@ class MaxBufferSizeTest(AsyncHTTPTestCase):
 
         class LargeBody(RequestHandler):
             def get(self):
-                self.write("a"*1024*100)
+                self.write("a" * 1024 * 100)
 
         return Application([('/large', LargeBody)])
 
     def get_http_client(self):
         # 100KB body with 64KB buffer
-        return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024*100, max_buffer_size=1024*64)
+        return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024 * 100, max_buffer_size=1024 * 64)
 
     def test_large_body(self):
         response = self.fetch('/large')
         response.rethrow()
-        self.assertEqual(response.body, b'a'*1024*100)
+        self.assertEqual(response.body, b'a' * 1024 * 100)
index 84c950769e4a9a31ec91d287355643759d711265..d85076a44721fde58bc6b6687beb84ac670fcd75 100644 (file)
@@ -18,7 +18,7 @@ class TCPServerTest(AsyncTestCase):
             def handle_stream(self, stream, address):
                 yield gen.moment
                 stream.close()
-                1/0
+                1 / 0
 
         server = client = None
         try:
index 0c8eb51cb896335bbea403b51953c3576caeb260..031b2f540a3997f17b909d12b114aaed1fa1bb31 100644 (file)
@@ -272,7 +272,7 @@ class ParseErrorDetailTest(unittest.TestCase):
     def test_details(self):
         loader = DictLoader({
             "foo.html": "\n\n{{",
-            })
+        })
         with self.assertRaises(ParseError) as cm:
             loader.load("foo.html")
         self.assertEqual("Missing end expression }} at foo.html:3",
@@ -448,7 +448,7 @@ raw: {% raw name %}""",
         templates = {
             "foo.html": "\t\tfoo\n\n",
             "bar.txt": "\t\tbar\n\n",
-            }
+        }
         loader = DictLoader(templates, whitespace='all')
         self.assertEqual(loader.load("foo.html").generate(), b"\t\tfoo\n\n")
         self.assertEqual(loader.load("bar.txt").generate(), b"\t\tbar\n\n")
index 3acbbfd95bcb4ceb345f5f00e47173b72fcfa259..f04db9597e7fcad0b6ed556714b9375de938774e 100644 (file)
@@ -1638,10 +1638,10 @@ class ExceptionHandlerTest(SimpleHandlerTestCase):
 class BuggyLoggingTest(SimpleHandlerTestCase):
     class Handler(RequestHandler):
         def get(self):
-            1/0
+            1 / 0
 
         def log_exception(self, typ, value, tb):
-            1/0
+            1 / 0
 
     def test_buggy_log_exception(self):
         # Something gets logged even though the application's