diff options
author | Yury Selivanov <yury@magic.io> | 2016-10-07 16:39:57 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-10-07 16:39:57 (GMT) |
commit | 36e7e97d621863e6e3e3baeb22909ec06e720639 (patch) | |
tree | 1ff713b9edd886a5053ebbccb8ab107a45b0cbc1 /Lib/test/test_asyncio/test_unix_events.py | |
parent | 95cdf364c8a77cc123d0435b8d6ef5f989dd7132 (diff) | |
download | cpython-36e7e97d621863e6e3e3baeb22909ec06e720639.zip cpython-36e7e97d621863e6e3e3baeb22909ec06e720639.tar.gz cpython-36e7e97d621863e6e3e3baeb22909ec06e720639.tar.bz2 |
asyncio: Only allow Unix Stream sockets for loop.create_unix_server/connection
Diffstat (limited to 'Lib/test/test_asyncio/test_unix_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_unix_events.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 088ef40..0d54e3a 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -273,7 +273,16 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase): coro = self.loop.create_unix_server(lambda: None, path=None, sock=sock) with self.assertRaisesRegex(ValueError, - 'A UNIX Domain Socket was expected'): + 'A UNIX Domain Stream.*was expected'): + self.loop.run_until_complete(coro) + + def test_create_unix_connection_path_inetsock(self): + sock = socket.socket() + with sock: + coro = self.loop.create_unix_connection(lambda: None, path=None, + sock=sock) + with self.assertRaisesRegex(ValueError, + 'A UNIX Domain Stream.*was expected'): self.loop.run_until_complete(coro) @mock.patch('asyncio.unix_events.socket') |