asyncio: test_selector_events: remove duplicate call to _on_handshake() method

The _SelectorSslTransport constructor already calls it.
This commit is contained in:
Victor Stinner 2014-07-16 18:02:10 +02:00
parent 9b7f9e6c5a
commit 1314f06293
1 changed files with 3 additions and 3 deletions

View File

@ -1089,17 +1089,17 @@ class SelectorSslTransportTests(test_utils.TestCase):
self.assertIsNone(waiter.result()) self.assertIsNone(waiter.result())
def test_on_handshake_reader_retry(self): def test_on_handshake_reader_retry(self):
self.loop.set_debug(False)
self.sslsock.do_handshake.side_effect = ssl.SSLWantReadError self.sslsock.do_handshake.side_effect = ssl.SSLWantReadError
transport = _SelectorSslTransport( transport = _SelectorSslTransport(
self.loop, self.sock, self.protocol, self.sslcontext) self.loop, self.sock, self.protocol, self.sslcontext)
transport._on_handshake(None)
self.loop.assert_reader(1, transport._on_handshake, None) self.loop.assert_reader(1, transport._on_handshake, None)
def test_on_handshake_writer_retry(self): def test_on_handshake_writer_retry(self):
self.loop.set_debug(False)
self.sslsock.do_handshake.side_effect = ssl.SSLWantWriteError self.sslsock.do_handshake.side_effect = ssl.SSLWantWriteError
transport = _SelectorSslTransport( transport = _SelectorSslTransport(
self.loop, self.sock, self.protocol, self.sslcontext) self.loop, self.sock, self.protocol, self.sslcontext)
transport._on_handshake(None)
self.loop.assert_writer(1, transport._on_handshake, None) self.loop.assert_writer(1, transport._on_handshake, None)
def test_on_handshake_exc(self): def test_on_handshake_exc(self):
@ -1120,7 +1120,7 @@ class SelectorSslTransportTests(test_utils.TestCase):
exc = BaseException() exc = BaseException()
self.sslsock.do_handshake.side_effect = exc self.sslsock.do_handshake.side_effect = exc
with test_utils.disable_logger(): with test_utils.disable_logger():
self.assertRaises(BaseException, transport._on_handshake, None) self.assertRaises(BaseException, transport._on_handshake, 0)
self.assertTrue(self.sslsock.close.called) self.assertTrue(self.sslsock.close.called)
self.assertTrue(transport._waiter.done()) self.assertTrue(transport._waiter.done())
self.assertIs(exc, transport._waiter.exception()) self.assertIs(exc, transport._waiter.exception())