diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-28 20:33:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 20:33:20 (GMT) |
commit | ac577d7d0bd27a69921ced14c09172235ceebab5 (patch) | |
tree | 0d8e39b6dbab0cd260764fa8acaf0390a8c509b6 /Lib/test/test_asyncio/test_windows_utils.py | |
parent | 4d193bcc2560b824389e4d98d9d8b9b34e33dbaf (diff) | |
download | cpython-ac577d7d0bd27a69921ced14c09172235ceebab5.zip cpython-ac577d7d0bd27a69921ced14c09172235ceebab5.tar.gz cpython-ac577d7d0bd27a69921ced14c09172235ceebab5.tar.bz2 |
bpo-32154: Remove asyncio.windows_utils.socketpair (#4609)
Diffstat (limited to 'Lib/test/test_asyncio/test_windows_utils.py')
-rw-r--r-- | Lib/test/test_asyncio/test_windows_utils.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py index 4fddaa2..952f95e 100644 --- a/Lib/test/test_asyncio/test_windows_utils.py +++ b/Lib/test/test_asyncio/test_windows_utils.py @@ -19,56 +19,6 @@ except ImportError: from asyncio import test_support as support -class WinsocketpairTests(unittest.TestCase): - - def check_winsocketpair(self, ssock, csock): - csock.send(b'xxx') - self.assertEqual(b'xxx', ssock.recv(1024)) - csock.close() - ssock.close() - - def test_winsocketpair(self): - ssock, csock = windows_utils.socketpair() - self.check_winsocketpair(ssock, csock) - - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled') - def test_winsocketpair_ipv6(self): - ssock, csock = windows_utils.socketpair(family=socket.AF_INET6) - self.check_winsocketpair(ssock, csock) - - @unittest.skipIf(hasattr(socket, 'socketpair'), - 'socket.socketpair is available') - @mock.patch('asyncio.windows_utils.socket') - def test_winsocketpair_exc(self, m_socket): - m_socket.AF_INET = socket.AF_INET - m_socket.SOCK_STREAM = socket.SOCK_STREAM - m_socket.socket.return_value.getsockname.return_value = ('', 12345) - m_socket.socket.return_value.accept.return_value = object(), object() - m_socket.socket.return_value.connect.side_effect = OSError() - - self.assertRaises(OSError, windows_utils.socketpair) - - def test_winsocketpair_invalid_args(self): - self.assertRaises(ValueError, - windows_utils.socketpair, family=socket.AF_UNSPEC) - self.assertRaises(ValueError, - windows_utils.socketpair, type=socket.SOCK_DGRAM) - self.assertRaises(ValueError, - windows_utils.socketpair, proto=1) - - @unittest.skipIf(hasattr(socket, 'socketpair'), - 'socket.socketpair is available') - @mock.patch('asyncio.windows_utils.socket') - def test_winsocketpair_close(self, m_socket): - m_socket.AF_INET = socket.AF_INET - m_socket.SOCK_STREAM = socket.SOCK_STREAM - sock = mock.Mock() - m_socket.socket.return_value = sock - sock.bind.side_effect = OSError - self.assertRaises(OSError, windows_utils.socketpair) - self.assertTrue(sock.close.called) - - class PipeTests(unittest.TestCase): def test_pipe_overlapped(self): |