Commit 2a9bd057 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

chore(flake8): please the flake8 god

parent a7dce2f16b9d
......@@ -58,9 +58,9 @@ from email.utils import formatdate
def sign(req, token):
headers_to_sign = ('Content-SHA512', 'Content-Type', 'Date')
to_sign = (req.method + req.url +
''.join(req.headers.get(field, '')
for field in headers_to_sign))
to_sign = (req.method + req.url
+ ''.join(req.headers.get(field, '')
for field in headers_to_sign))
return hmac.new(token, to_sign).hexdigest()
......
......@@ -42,8 +42,8 @@ class PyramidSignedRequestTC(SignedRequestBaseTC, PyramidCWTest):
def _build_string_to_sign(self, request):
get_headers = itemgetter(*HEADERS_TO_SIGN)
return (request.method + request.url +
''.join(get_headers(request.headers))).encode('utf-8')
return (request.method + request.url
+ ''.join(get_headers(request.headers))).encode('utf-8')
def _test_header_format(self, method, login, http_method='GET',
signature=None, headers=None,
......
......@@ -37,9 +37,9 @@ class SignedRequestTC(SignedRequestBaseTC, CubicWebTC):
self.assertGreater(req.status_out, 400)
def _build_string_to_sign(self, request):
return (request.http_method() + request.url() +
''.join(request.get_header(header)
for header in HEADERS_TO_SIGN)).encode('utf-8')
return (request.http_method() + request.url()
+ ''.join(request.get_header(header)
for header in HEADERS_TO_SIGN)).encode('utf-8')
def _test_header_format(self, method, login, http_method='GET',
signature=None, headers=None,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment