E128 Continuation line under-indented for visual indent
MODIFY
test/test_filepost.py
test/test_filepost.py
@@ -48,9 +48,7 @@ class TestMultipartEncoding(unittest.TestCase):
for fields in fieldsets:
encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
-
- self.assertEqual(encoded,
- b'--' + b(BOUNDARY) + b'\r\n'
+ expected = (b'--' + b(BOUNDARY) + b'\r\n'
b'Content-Disposition: form-data; name="k"\r\n'
b'\r\n'
b'v\r\n'
@@ -58,8 +56,9 @@ class TestMultipartEncoding(unittest.TestCase):
b'Content-Disposition: form-data; name="k2"\r\n'
b'\r\n'
b'v2\r\n'
- b'--' + b(BOUNDARY) + b'--\r\n'
- , fields)
+ b'--' + b(BOUNDARY) + b'--\r\n')
+
+ self.assertEqual(encoded, expected, fields)
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
@@ -68,15 +67,14 @@ class TestMultipartEncoding(unittest.TestCase):
fields = [('k', ('somename', b'v'))]
encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
-
- self.assertEqual(encoded,
- b'--' + b(BOUNDARY) + b'\r\n'
+ expected = (b'--' + b(BOUNDARY) + b'\r\n'
b'Content-Disposition: form-data; name="k"; filename="somename"\r\n'
b'Content-Type: application/octet-stream\r\n'
b'\r\n'
b'v\r\n'
- b'--' + b(BOUNDARY) + b'--\r\n'
- )
+ b'--' + b(BOUNDARY) + b'--\r\n')
+
+ self.assertEqual(encoded, expected)
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
@@ -85,15 +83,14 @@ class TestMultipartEncoding(unittest.TestCase):
fields = [('k', ('somefile.txt', b'v'))]
encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
-
- self.assertEqual(encoded,
- b'--' + b(BOUNDARY) + b'\r\n'
+ expected = (b'--' + b(BOUNDARY) + b'\r\n'
b'Content-Disposition: form-data; name="k"; filename="somefile.txt"\r\n'
b'Content-Type: text/plain\r\n'
b'\r\n'
b'v\r\n'
- b'--' + b(BOUNDARY) + b'--\r\n'
- )
+ b'--' + b(BOUNDARY) + b'--\r\n')
+
+ self.assertEqual(encoded, expected)
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
@@ -102,15 +99,14 @@ class TestMultipartEncoding(unittest.TestCase):
fields = [('k', ('somefile.txt', b'v', 'image/jpeg'))]
encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
-
- self.assertEqual(encoded,
- b'--' + b(BOUNDARY) + b'\r\n'
+ expected = (b'--' + b(BOUNDARY) + b'\r\n'
b'Content-Disposition: form-data; name="k"; filename="somefile.txt"\r\n'
b'Content-Type: image/jpeg\r\n'
b'\r\n'
b'v\r\n'
- b'--' + b(BOUNDARY) + b'--\r\n'
- )
+ b'--' + b(BOUNDARY) + b'--\r\n')
+
+ self.assertEqual(encoded, expected)
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
@@ -119,11 +115,10 @@ class TestMultipartEncoding(unittest.TestCase):
fields = [RequestField('k', b'v', filename='somefile.txt', headers={'Content-Type': 'image/jpeg'})]
encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
-
- self.assertEqual(encoded,
- b'--' + b(BOUNDARY) + b'\r\n'
+ expected = (b'--' + b(BOUNDARY) + b'\r\n'
b'Content-Type: image/jpeg\r\n'
b'\r\n'
b'v\r\n'
- b'--' + b(BOUNDARY) + b'--\r\n'
- )
+ b'--' + b(BOUNDARY) + b'--\r\n')
+
+ self.assertEqual(encoded, expected)

MODIFY
test/with_dummyserver/test_connectionpool.py
test/with_dummyserver/test_connectionpool.py
@@ -678,7 +678,9 @@ class TestConnectionPool(HTTPDummyServerTestCase):
# url. We won't get a response for this and so the
# conn won't be implicitly returned to the pool.
self.assertRaises(MaxRetryError,
- http.request, 'GET', '/redirect', fields={'target': '/'}, release_conn=False, retries=0)
+ http.request,
+ 'GET', '/redirect',
+ fields={'target': '/'}, release_conn=False, retries=0)
r = http.request('GET', '/redirect', fields={'target': '/'}, release_conn=False, retries=1)
r.release_conn()

MODIFY
test/with_dummyserver/test_https.py
test/with_dummyserver/test_https.py
@@ -428,7 +428,8 @@ class TestHTTPS(HTTPSDummyServerTestCase):
conn = VerifiedHTTPSConnection(self.host, self.port)
https_pool = HTTPSConnectionPool(self.host, self.port,
- cert_reqs='CERT_REQUIRED', ca_certs=DEFAULT_CA,
+ cert_reqs='CERT_REQUIRED',
+ ca_certs=DEFAULT_CA,
assert_fingerprint=fingerprint)
https_pool._make_request(conn, 'GET', '/')

MODIFY
test/with_dummyserver/test_socketlevel.py
test/with_dummyserver/test_socketlevel.py
@@ -393,13 +393,11 @@ class TestSocketClosing(SocketDummyServerTestCase):
buf = sock.recv(65536)
# Send partial response and close socket.
- sock.send((
- 'HTTP/1.1 200 OK\r\n'
+ sock.send(('HTTP/1.1 200 OK\r\n'
'Content-Type: text/plain\r\n'
'Content-Length: %d\r\n'
'\r\n'
- '%s' % (len(body), partial_body)).encode('utf-8')
- )
+ '%s' % (len(body), partial_body)).encode('utf-8'))
sock.close()
self._start_server(socket_handler)

E128 Continuation line under-indented for visual indent