Merge "pep8: Turn on E305"
This commit is contained in:
commit
a495f1e327
@ -79,5 +79,6 @@ class Linkat(object):
|
||||
|
||||
return self._c_linkat(olddirfd, oldpath, newdirfd, newpath, flags)
|
||||
|
||||
|
||||
linkat = Linkat()
|
||||
del Linkat
|
||||
|
@ -98,6 +98,7 @@ class Tee(object):
|
||||
|
||||
return self._c_tee is not None
|
||||
|
||||
|
||||
tee = Tee()
|
||||
del Tee
|
||||
|
||||
@ -195,5 +196,6 @@ class Splice(object):
|
||||
|
||||
return self._c_splice is not None
|
||||
|
||||
|
||||
splice = Splice()
|
||||
del Splice
|
||||
|
@ -138,6 +138,7 @@ def NR_ioprio_set():
|
||||
raise OSError("Swift doesn't support ionice priority for %s %s" %
|
||||
(architecture, arch_bits))
|
||||
|
||||
|
||||
# this syscall integer probably only works on x86_64 linux systems, you
|
||||
# can check if it's correct on yours with something like this:
|
||||
"""
|
||||
@ -169,6 +170,7 @@ IOPRIO_CLASS_SHIFT = 13
|
||||
def IOPRIO_PRIO_VALUE(class_, data):
|
||||
return (((class_) << IOPRIO_CLASS_SHIFT) | data)
|
||||
|
||||
|
||||
# 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
|
||||
# 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_test2')
|
||||
|
||||
|
||||
cluster_info = {}
|
||||
|
||||
|
||||
|
@ -1105,5 +1105,6 @@ class TestS3ApiMultiUploadSigV4(TestS3ApiMultiUpload):
|
||||
self.conn.make_request('DELETE', bucket)
|
||||
self.assertEqual(status, 204) # sanity
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -96,5 +96,6 @@ class TestS3ApiServiceSigV4(TestS3ApiService):
|
||||
def setUp(self):
|
||||
super(TestS3ApiServiceSigV4, self).setUp()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -172,5 +172,6 @@ class TestEmptyDevice(ReplProbeTest):
|
||||
else:
|
||||
self.fail("Expected ClientException but didn't get it")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -64,6 +64,7 @@ import unittest
|
||||
class SkipTest(unittest.SkipTest):
|
||||
pass
|
||||
|
||||
|
||||
EMPTY_ETAG = md5().hexdigest()
|
||||
|
||||
# try not to import this module from swift
|
||||
|
@ -111,5 +111,6 @@ class TestFormSignature(unittest.TestCase):
|
||||
'-922337203685477580799999999999999', key])
|
||||
self.assertNotEqual(exitcode, 0)
|
||||
|
||||
|
||||
if __name__ == '__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,
|
||||
project_id, project_domain_id, reauthenticate)
|
||||
|
||||
|
||||
ERR_MESSAGE_SECRET_INCORRECTLY_SPECIFIED = 'Secret incorrectly specified.'
|
||||
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['c'], False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -62,5 +62,6 @@ class TestS3ApiLogging(S3ApiTestCase):
|
||||
status, headers, body = self.call_s3api(req)
|
||||
self.assertEqual(self._get_error_code(body), 'NoLoggingStatusForKey')
|
||||
|
||||
|
||||
if __name__ == '__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, string_to_md5=b'test')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -537,5 +537,6 @@ class TestS3ApiS3Acl(S3ApiTestCase):
|
||||
self.assertRaises(TypeError, fake_class.s3acl_s3only_error)
|
||||
self.assertIsNone(fake_class.s3acl_s3only_no_error())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -233,5 +233,6 @@ class TestS3ApiService(S3ApiTestCase):
|
||||
self.assertTrue(i[0] in names)
|
||||
self.assertEqual(len(self.swift.calls_with_headers), 11)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -363,5 +363,6 @@ class TestS3ApiSubresource(unittest.TestCase):
|
||||
func = lambda: '' in grantee
|
||||
self.assertRaises(S3NotImplemented, func)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -129,5 +129,6 @@ class TestS3ApiUtils(unittest.TestCase):
|
||||
os.environ['TZ'] = orig_tz
|
||||
time.tzset()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -521,5 +521,6 @@ class AccountQuotaCopyingTestCases(unittest.TestCase):
|
||||
res = req.get_response(self.copy_filter)
|
||||
self.assertEqual(res.status_int, 412)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1609,5 +1609,6 @@ class PrefixAccount(unittest.TestCase):
|
||||
self.assertFalse(test_auth._account_matches_tenant(
|
||||
'PRE2_1234', '5678'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -147,5 +147,6 @@ class TestSwiftInfo(unittest.TestCase):
|
||||
self.assertEqual(swift_info['name_check'].get('forbidden_regexp'),
|
||||
r"/\./|/\.\./|/\.$")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -356,5 +356,6 @@ class ContainerQuotaCopyingTestCases(unittest.TestCase):
|
||||
res = req.get_response(self.copy_filter)
|
||||
self.assertEqual(res.status_int, 200)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1828,5 +1828,6 @@ class TestUtilityMethods(unittest.TestCase):
|
||||
req = Request({'PATH_INFO': '/'})
|
||||
self.assertRaises(ValueError, auth_inst.account_acls, req)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -922,5 +922,6 @@ class TestUTF8DirectClient(TestDirectClient):
|
||||
self.container = self.container.encode('utf-8')
|
||||
self.obj = self.obj.encode('utf-8')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -46,5 +46,6 @@ class TestExceptions(unittest.TestCase):
|
||||
http_response_content='content')
|
||||
self.assertEqual(str(exc), strerror)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1691,5 +1691,6 @@ class TestSimpleClient(unittest.TestCase):
|
||||
# See above
|
||||
self.assertEqual('https', args[0].type)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -2279,5 +2279,6 @@ class TestManager(unittest.TestCase):
|
||||
self.assertEqual(status, 0)
|
||||
self.assertEqual(m.cmd_was_called, True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -528,5 +528,6 @@ class TestContainerUpdater(unittest.TestCase):
|
||||
self.assertEqual(info['reported_object_count'], 0)
|
||||
self.assertEqual(info['reported_bytes_used'], 0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -8388,5 +8388,6 @@ class TestHashesHelpers(unittest.TestCase):
|
||||
result = diskfile.read_hashes(self.testdir)
|
||||
self.assertFalse(result['valid'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -73,6 +73,7 @@ def mock_http_connect(status):
|
||||
return
|
||||
return lambda *args, **kwargs: FakeConn(status, *args, **kwargs)
|
||||
|
||||
|
||||
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
|
||||
# Disabled with going to hacking 2.0, needs further investigation and
|
||||
# changes to enable:
|
||||
# E305 expected 2 blank lines after class or function definition, found 1
|
||||
# E402: module level import not at top of file
|
||||
# E731 do not assign a lambda expression, use a def
|
||||
# Swift team needs to decide if they want to enable either of these:
|
||||
# W503: line break before 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
|
||||
filename = *.py,bin/*
|
||||
show-source = True
|
||||
|
Loading…
Reference in New Issue
Block a user