self._on_get_user_info, future, session, fields),
access_token=session["access_token"],
appsecret_proof=hmac.new(key=client_secret.encode('utf8'),
- msg=session["access_token"].encode('utf8'),
- digestmod=hashlib.sha256).hexdigest(),
+ msg=session["access_token"].encode('utf8'),
+ digestmod=hashlib.sha256).hexdigest(),
fields=",".join(fields)
)
parsed = json_decode(response.body)
self.assertEqual(parsed,
{u'access_token': {u'key': u'hjkl',
- u'screen_name': u'foo',
- u'secret': u'vbnm'},
+ u'screen_name': u'foo',
+ u'secret': u'vbnm'},
u'name': u'Foo',
u'screen_name': u'foo',
u'username': u'foo'})
def test_chunked_with_content_length(self):
# Make sure the invalid headers are detected
with ExpectLog(gen_log, ("Malformed HTTP message from None: Response "
- "with both Transfer-Encoding and Content-Length")):
+ "with both Transfer-Encoding and Content-Length")):
response = self.fetch('/chunkwithcl')
self.assertEqual(response.code, 599)
def test_httperror_str_from_httputil(self):
self.assertEqual(str(HTTPError(682)), "HTTP 682: Unknown")
+
@wsgi_safe
class ErrorHandlerXSRFTest(WebTestCase):
def get_handlers(self):
'data_received', 'data_received',
'post']))
+
class DecoratedStreamingRequestFlowControlTest(
BaseStreamingRequestFlowControlTest,
WebTestCase):
Returns a tuple (socket, port).
"""
sock = netutil.bind_sockets(None, '127.0.0.1', family=socket.AF_INET,
- reuse_port=reuse_port)[0]
+ reuse_port=reuse_port)[0]
port = sock.getsockname()[1]
return sock, port