pep8: Turn on E305
Change-Id: Ia968ec7375ab346a2155769a46e74ce694a57fc2
This commit is contained in:
parent
96b56519bf
commit
668242c422
@ -79,5 +79,6 @@ class Linkat(object):
|
|||||||
|
|
||||||
return self._c_linkat(olddirfd, oldpath, newdirfd, newpath, flags)
|
return self._c_linkat(olddirfd, oldpath, newdirfd, newpath, flags)
|
||||||
|
|
||||||
|
|
||||||
linkat = Linkat()
|
linkat = Linkat()
|
||||||
del Linkat
|
del Linkat
|
||||||
|
@ -98,6 +98,7 @@ class Tee(object):
|
|||||||
|
|
||||||
return self._c_tee is not None
|
return self._c_tee is not None
|
||||||
|
|
||||||
|
|
||||||
tee = Tee()
|
tee = Tee()
|
||||||
del Tee
|
del Tee
|
||||||
|
|
||||||
@ -195,5 +196,6 @@ class Splice(object):
|
|||||||
|
|
||||||
return self._c_splice is not None
|
return self._c_splice is not None
|
||||||
|
|
||||||
|
|
||||||
splice = Splice()
|
splice = Splice()
|
||||||
del Splice
|
del Splice
|
||||||
|
@ -137,6 +137,7 @@ def NR_ioprio_set():
|
|||||||
raise OSError("Swift doesn't support ionice priority for %s %s" %
|
raise OSError("Swift doesn't support ionice priority for %s %s" %
|
||||||
(architecture, arch_bits))
|
(architecture, arch_bits))
|
||||||
|
|
||||||
|
|
||||||
# this syscall integer probably only works on x86_64 linux systems, you
|
# this syscall integer probably only works on x86_64 linux systems, you
|
||||||
# can check if it's correct on yours with something like this:
|
# can check if it's correct on yours with something like this:
|
||||||
"""
|
"""
|
||||||
@ -168,6 +169,7 @@ IOPRIO_CLASS_SHIFT = 13
|
|||||||
def IOPRIO_PRIO_VALUE(class_, data):
|
def IOPRIO_PRIO_VALUE(class_, data):
|
||||||
return (((class_) << IOPRIO_CLASS_SHIFT) | data)
|
return (((class_) << IOPRIO_CLASS_SHIFT) | data)
|
||||||
|
|
||||||
|
|
||||||
# Used by hash_path to offer a bit more security when generating hashes for
|
# Used by hash_path to offer a bit more security when generating hashes for
|
||||||
# paths. It simply appends this value to all paths; guessing the hash a path
|
# paths. It simply appends this value to all paths; guessing the hash a path
|
||||||
# will end up with would also require knowing this suffix.
|
# will end up with would also require knowing this suffix.
|
||||||
|
@ -725,6 +725,7 @@ def in_process_setup(the_object_server=object_server):
|
|||||||
create_account('AUTH_test')
|
create_account('AUTH_test')
|
||||||
create_account('AUTH_test2')
|
create_account('AUTH_test2')
|
||||||
|
|
||||||
|
|
||||||
cluster_info = {}
|
cluster_info = {}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1105,5 +1105,6 @@ class TestS3ApiMultiUploadSigV4(TestS3ApiMultiUpload):
|
|||||||
self.conn.make_request('DELETE', bucket)
|
self.conn.make_request('DELETE', bucket)
|
||||||
self.assertEqual(status, 204) # sanity
|
self.assertEqual(status, 204) # sanity
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -96,5 +96,6 @@ class TestS3ApiServiceSigV4(TestS3ApiService):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestS3ApiServiceSigV4, self).setUp()
|
super(TestS3ApiServiceSigV4, self).setUp()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -172,5 +172,6 @@ class TestEmptyDevice(ReplProbeTest):
|
|||||||
else:
|
else:
|
||||||
self.fail("Expected ClientException but didn't get it")
|
self.fail("Expected ClientException but didn't get it")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@ -64,6 +64,7 @@ import unittest
|
|||||||
class SkipTest(unittest.SkipTest):
|
class SkipTest(unittest.SkipTest):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
EMPTY_ETAG = md5().hexdigest()
|
EMPTY_ETAG = md5().hexdigest()
|
||||||
|
|
||||||
# try not to import this module from swift
|
# try not to import this module from swift
|
||||||
|
@ -111,5 +111,6 @@ class TestFormSignature(unittest.TestCase):
|
|||||||
'-922337203685477580799999999999999', key])
|
'-922337203685477580799999999999999', key])
|
||||||
self.assertNotEqual(exitcode, 0)
|
self.assertNotEqual(exitcode, 0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -89,6 +89,7 @@ def mock_keystone_password_side_effect(auth_url, username, password,
|
|||||||
user_domain_id, trust_id, domain_id, domain_name,
|
user_domain_id, trust_id, domain_id, domain_name,
|
||||||
project_id, project_domain_id, reauthenticate)
|
project_id, project_domain_id, reauthenticate)
|
||||||
|
|
||||||
|
|
||||||
ERR_MESSAGE_SECRET_INCORRECTLY_SPECIFIED = 'Secret incorrectly specified.'
|
ERR_MESSAGE_SECRET_INCORRECTLY_SPECIFIED = 'Secret incorrectly specified.'
|
||||||
ERR_MESSAGE_KEY_UUID_NOT_FOUND = 'Key not found, uuid: '
|
ERR_MESSAGE_KEY_UUID_NOT_FOUND = 'Key not found, uuid: '
|
||||||
|
|
||||||
|
@ -40,5 +40,6 @@ class TestS3ApiCfg(unittest.TestCase):
|
|||||||
self.assertEqual(conf['b'], 100)
|
self.assertEqual(conf['b'], 100)
|
||||||
self.assertEqual(conf['c'], False)
|
self.assertEqual(conf['c'], False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -62,5 +62,6 @@ class TestS3ApiLogging(S3ApiTestCase):
|
|||||||
status, headers, body = self.call_s3api(req)
|
status, headers, body = self.call_s3api(req)
|
||||||
self.assertEqual(self._get_error_code(body), 'NoLoggingStatusForKey')
|
self.assertEqual(self._get_error_code(body), 'NoLoggingStatusForKey')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -531,5 +531,6 @@ class TestS3ApiMultiDelete(S3ApiTestCase):
|
|||||||
self._test_no_body(use_transfer_encoding=True)
|
self._test_no_body(use_transfer_encoding=True)
|
||||||
self._test_no_body(use_transfer_encoding=True, string_to_md5=b'test')
|
self._test_no_body(use_transfer_encoding=True, string_to_md5=b'test')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -537,5 +537,6 @@ class TestS3ApiS3Acl(S3ApiTestCase):
|
|||||||
self.assertRaises(TypeError, fake_class.s3acl_s3only_error)
|
self.assertRaises(TypeError, fake_class.s3acl_s3only_error)
|
||||||
self.assertIsNone(fake_class.s3acl_s3only_no_error())
|
self.assertIsNone(fake_class.s3acl_s3only_no_error())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1251,5 +1251,6 @@ class TestS3ApiMiddleware(S3ApiTestCase):
|
|||||||
self.assertEqual(body, b'')
|
self.assertEqual(body, b'')
|
||||||
self.assertEqual(1, mock_req.call_count)
|
self.assertEqual(1, mock_req.call_count)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -233,5 +233,6 @@ class TestS3ApiService(S3ApiTestCase):
|
|||||||
self.assertTrue(i[0] in names)
|
self.assertTrue(i[0] in names)
|
||||||
self.assertEqual(len(self.swift.calls_with_headers), 11)
|
self.assertEqual(len(self.swift.calls_with_headers), 11)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -363,5 +363,6 @@ class TestS3ApiSubresource(unittest.TestCase):
|
|||||||
func = lambda: '' in grantee
|
func = lambda: '' in grantee
|
||||||
self.assertRaises(S3NotImplemented, func)
|
self.assertRaises(S3NotImplemented, func)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -129,5 +129,6 @@ class TestS3ApiUtils(unittest.TestCase):
|
|||||||
os.environ['TZ'] = orig_tz
|
os.environ['TZ'] = orig_tz
|
||||||
time.tzset()
|
time.tzset()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -521,5 +521,6 @@ class AccountQuotaCopyingTestCases(unittest.TestCase):
|
|||||||
res = req.get_response(self.copy_filter)
|
res = req.get_response(self.copy_filter)
|
||||||
self.assertEqual(res.status_int, 412)
|
self.assertEqual(res.status_int, 412)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1609,5 +1609,6 @@ class PrefixAccount(unittest.TestCase):
|
|||||||
self.assertFalse(test_auth._account_matches_tenant(
|
self.assertFalse(test_auth._account_matches_tenant(
|
||||||
'PRE2_1234', '5678'))
|
'PRE2_1234', '5678'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -147,5 +147,6 @@ class TestSwiftInfo(unittest.TestCase):
|
|||||||
self.assertEqual(swift_info['name_check'].get('forbidden_regexp'),
|
self.assertEqual(swift_info['name_check'].get('forbidden_regexp'),
|
||||||
r"/\./|/\.\./|/\.$")
|
r"/\./|/\.\./|/\.$")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -356,5 +356,6 @@ class ContainerQuotaCopyingTestCases(unittest.TestCase):
|
|||||||
res = req.get_response(self.copy_filter)
|
res = req.get_response(self.copy_filter)
|
||||||
self.assertEqual(res.status_int, 200)
|
self.assertEqual(res.status_int, 200)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1828,5 +1828,6 @@ class TestUtilityMethods(unittest.TestCase):
|
|||||||
req = Request({'PATH_INFO': '/'})
|
req = Request({'PATH_INFO': '/'})
|
||||||
self.assertRaises(ValueError, auth_inst.account_acls, req)
|
self.assertRaises(ValueError, auth_inst.account_acls, req)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -922,5 +922,6 @@ class TestUTF8DirectClient(TestDirectClient):
|
|||||||
self.container = self.container.encode('utf-8')
|
self.container = self.container.encode('utf-8')
|
||||||
self.obj = self.obj.encode('utf-8')
|
self.obj = self.obj.encode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -46,5 +46,6 @@ class TestExceptions(unittest.TestCase):
|
|||||||
http_response_content='content')
|
http_response_content='content')
|
||||||
self.assertEqual(str(exc), strerror)
|
self.assertEqual(str(exc), strerror)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1691,5 +1691,6 @@ class TestSimpleClient(unittest.TestCase):
|
|||||||
# See above
|
# See above
|
||||||
self.assertEqual('https', args[0].type)
|
self.assertEqual('https', args[0].type)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -2279,5 +2279,6 @@ class TestManager(unittest.TestCase):
|
|||||||
self.assertEqual(status, 0)
|
self.assertEqual(status, 0)
|
||||||
self.assertEqual(m.cmd_was_called, True)
|
self.assertEqual(m.cmd_was_called, True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -528,5 +528,6 @@ class TestContainerUpdater(unittest.TestCase):
|
|||||||
self.assertEqual(info['reported_object_count'], 0)
|
self.assertEqual(info['reported_object_count'], 0)
|
||||||
self.assertEqual(info['reported_bytes_used'], 0)
|
self.assertEqual(info['reported_bytes_used'], 0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -8388,5 +8388,6 @@ class TestHashesHelpers(unittest.TestCase):
|
|||||||
result = diskfile.read_hashes(self.testdir)
|
result = diskfile.read_hashes(self.testdir)
|
||||||
self.assertFalse(result['valid'])
|
self.assertFalse(result['valid'])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -73,6 +73,7 @@ def mock_http_connect(status):
|
|||||||
return
|
return
|
||||||
return lambda *args, **kwargs: FakeConn(status, *args, **kwargs)
|
return lambda *args, **kwargs: FakeConn(status, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
process_errors = []
|
process_errors = []
|
||||||
|
|
||||||
|
|
||||||
|
3
tox.ini
3
tox.ini
@ -129,13 +129,12 @@ commands = bandit -c bandit.yaml -r swift -n 5
|
|||||||
# H501: Do not use self.__dict__ for string formatting
|
# H501: Do not use self.__dict__ for string formatting
|
||||||
# Disabled with going to hacking 2.0, needs further investigation and
|
# Disabled with going to hacking 2.0, needs further investigation and
|
||||||
# changes to enable:
|
# changes to enable:
|
||||||
# E305 expected 2 blank lines after class or function definition, found 1
|
|
||||||
# E402: module level import not at top of file
|
# E402: module level import not at top of file
|
||||||
# E731 do not assign a lambda expression, use a def
|
# E731 do not assign a lambda expression, use a def
|
||||||
# Swift team needs to decide if they want to enable either of these:
|
# Swift team needs to decide if they want to enable either of these:
|
||||||
# W503: line break before binary operator
|
# W503: line break before binary operator
|
||||||
# W504: line break after binary operator
|
# W504: line break after binary operator
|
||||||
ignore = H101,H202,H301,H306,H404,H405,H501,W503,W504,E305,E402,E731
|
ignore = H101,H202,H301,H306,H404,H405,H501,W503,W504,E402,E731
|
||||||
exclude = .venv,.tox,dist,*egg
|
exclude = .venv,.tox,dist,*egg
|
||||||
filename = *.py,bin/*
|
filename = *.py,bin/*
|
||||||
show-source = True
|
show-source = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user