summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_selector_events.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-06-28 11:00:22 -0400
committerYury Selivanov <yury@magic.io>2016-06-28 11:00:22 -0400
commit63bf48768867a7421f8ccb956fe77f295bfd2742 (patch)
tree2f8307cab416b4208e5517423428d1c54fbce84d /Lib/test/test_asyncio/test_selector_events.py
parent77bc04a3bcb6c207f6b48f4e3418cd6a02909696 (diff)
downloadcpython-git-63bf48768867a7421f8ccb956fe77f295bfd2742.tar.gz
asyncio: Use socket specs for getaddrinfo() in sock_connect()
Patch by Martin Richard. GH PR #365.
Diffstat (limited to 'Lib/test/test_asyncio/test_selector_events.py')
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 5dc6ff8e66..ff71c218bb 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -373,6 +373,17 @@ class BaseSelectorEventLoopTests(test_utils.TestCase):
self.loop.run_until_complete(fut)
self.assertTrue(self.loop.remove_writer.called)
+ def test_sock_connect_resolve_using_socket_params(self):
+ addr = ('need-resolution.com', 8080)
+ sock = test_utils.mock_nonblocking_socket()
+ self.loop.getaddrinfo = mock.Mock()
+ self.loop.sock_connect(sock, addr)
+ while not self.loop.getaddrinfo.called:
+ self.loop._run_once()
+ self.loop.getaddrinfo.assert_called_with(
+ *addr, type=sock.type, family=sock.family, proto=sock.proto,
+ flags=0)
+
def test__sock_connect(self):
f = asyncio.Future(loop=self.loop)