mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Update web-platform-tests to revision a3a4442b04c37155f81c4ad4ae9c06339f76ce14
This commit is contained in:
parent
7b653cad7b
commit
ba0f5f096a
204 changed files with 4645 additions and 1001 deletions
|
@ -398,7 +398,7 @@ class WebSocketHandshake(object):
|
|||
# Validate
|
||||
try:
|
||||
decoded_accept = base64.b64decode(accept)
|
||||
except TypeError, e:
|
||||
except TypeError as e:
|
||||
raise HandshakeException(
|
||||
'Illegal value for header Sec-WebSocket-Accept: ' + accept)
|
||||
|
||||
|
@ -998,7 +998,7 @@ def connect_socket_with_retry(host, port, timeout, use_tls,
|
|||
if use_tls:
|
||||
return _TLSSocket(s)
|
||||
return s
|
||||
except socket.error, e:
|
||||
except socket.error as e:
|
||||
if e.errno != errno.ECONNREFUSED:
|
||||
raise
|
||||
else:
|
||||
|
@ -1063,7 +1063,7 @@ class Client(object):
|
|||
def assert_connection_closed(self):
|
||||
try:
|
||||
read_data = receive_bytes(self._socket, 1)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e).find(
|
||||
'Connection closed before receiving requested length ') == 0:
|
||||
return
|
||||
|
|
|
@ -519,7 +519,7 @@ class MuxClient(object):
|
|||
|
||||
try:
|
||||
send_quota = self._channel_slots.popleft()
|
||||
except IndexError, e:
|
||||
except IndexError as e:
|
||||
raise Exception('No channel slots: %r' % e)
|
||||
|
||||
# Create AddChannel request
|
||||
|
@ -632,7 +632,7 @@ class MuxClient(object):
|
|||
try:
|
||||
inner_frame = self._logical_channels[channel_id].queue.get(
|
||||
timeout=self._timeout)
|
||||
except Queue.Empty, e:
|
||||
except Queue.Empty as e:
|
||||
raise Exception('Cannot receive message from channel id %d' %
|
||||
channel_id)
|
||||
|
||||
|
@ -666,7 +666,7 @@ class MuxClient(object):
|
|||
try:
|
||||
inner_frame = self._logical_channels[channel_id].queue.get(
|
||||
timeout=self._timeout)
|
||||
except Queue.Empty, e:
|
||||
except Queue.Empty as e:
|
||||
raise Exception('Cannot receive message from channel id %d' %
|
||||
channel_id)
|
||||
if inner_frame.opcode != client_for_testing.OPCODE_CLOSE:
|
||||
|
|
|
@ -155,9 +155,9 @@ class DispatcherTest(unittest.TestCase):
|
|||
try:
|
||||
dispatcher.do_extra_handshake(request)
|
||||
self.fail('Could not catch HandshakeException with 403 status')
|
||||
except handshake.HandshakeException, e:
|
||||
except handshake.HandshakeException as e:
|
||||
self.assertEquals(403, e.status)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.fail('Unexpected exception: %r' % e)
|
||||
|
||||
def test_abort_extra_handshake(self):
|
||||
|
@ -212,7 +212,7 @@ class DispatcherTest(unittest.TestCase):
|
|||
try:
|
||||
dispatcher.transfer_data(request)
|
||||
self.fail()
|
||||
except dispatch.DispatchException, e:
|
||||
except dispatch.DispatchException as e:
|
||||
self.failUnless(str(e).find('No handler') != -1)
|
||||
except Exception:
|
||||
self.fail()
|
||||
|
@ -225,7 +225,7 @@ class DispatcherTest(unittest.TestCase):
|
|||
try:
|
||||
dispatcher.transfer_data(request)
|
||||
self.fail()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.failUnless(str(e).find('Intentional') != -1,
|
||||
'Unexpected exception: %s' % e)
|
||||
|
||||
|
|
|
@ -304,9 +304,9 @@ class EndToEndHyBiTest(EndToEndTestBase):
|
|||
try:
|
||||
client.connect()
|
||||
self.fail('Could not catch HttpStatusException')
|
||||
except client_for_testing.HttpStatusException, e:
|
||||
except client_for_testing.HttpStatusException as e:
|
||||
self.assertEqual(status, e.status)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.fail('Catch unexpected exception')
|
||||
finally:
|
||||
client.close_socket()
|
||||
|
|
|
@ -507,10 +507,10 @@ class HandshakerTest(unittest.TestCase):
|
|||
try:
|
||||
handshaker.do_handshake()
|
||||
self.fail('No exception thrown for \'%s\' case' % case_name)
|
||||
except HandshakeException, e:
|
||||
except HandshakeException as e:
|
||||
self.assertTrue(expect_handshake_exception)
|
||||
self.assertEqual(expected_status, e.status)
|
||||
except VersionException, e:
|
||||
except VersionException as e:
|
||||
self.assertFalse(expect_handshake_exception)
|
||||
|
||||
|
||||
|
|
|
@ -258,9 +258,9 @@ class _MuxMockDispatcher(object):
|
|||
raise ValueError('Cannot handle path %r' % request.path)
|
||||
if not request.server_terminated:
|
||||
request.ws_stream.close_connection()
|
||||
except ConnectionTerminatedException, e:
|
||||
except ConnectionTerminatedException as e:
|
||||
self.channel_events[request.channel_id].exception = e
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.channel_events[request.channel_id].exception = e
|
||||
raise
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue