mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-31245: Asyncio unix socket datagram (#3164)
This commit is contained in:
parent
a2314283ff
commit
fe4ea9cf1e
5 changed files with 24 additions and 5 deletions
|
@ -1528,6 +1528,17 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
|
|||
self.loop.run_until_complete(protocol.done)
|
||||
self.assertEqual('CLOSED', protocol.state)
|
||||
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
|
||||
def test_create_datagram_endpoint_sock_unix(self):
|
||||
fut = self.loop.create_datagram_endpoint(
|
||||
lambda: MyDatagramProto(create_future=True, loop=self.loop),
|
||||
family=socket.AF_UNIX)
|
||||
transport, protocol = self.loop.run_until_complete(fut)
|
||||
assert transport._sock.family == socket.AF_UNIX
|
||||
transport.close()
|
||||
self.loop.run_until_complete(protocol.done)
|
||||
self.assertEqual('CLOSED', protocol.state)
|
||||
|
||||
def test_create_datagram_endpoint_sock_sockopts(self):
|
||||
class FakeSock:
|
||||
type = socket.SOCK_DGRAM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue