Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
152c408e
Commit
152c408e
authored
Dec 16, 2015
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.4
parents
bcf8afd0
3cd863c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
Lib/test/test_asyncio/test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+29
-18
No files found.
Lib/test/test_asyncio/test_base_events.py
View file @
152c408e
...
...
@@ -1157,21 +1157,28 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self
.
loop
.
add_writer
=
mock
.
Mock
()
self
.
loop
.
add_writer
.
_is_coroutine
=
False
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'1.2.3.4'
,
80
)
self
.
loop
.
run_until_complete
(
coro
)
sock
.
connect
.
assert_called_with
((
'1.2.3.4'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
coro
=
self
.
loop
.
create_connection
(
asyncio
.
Protocol
,
'1.2.3.4'
,
80
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
sock
.
connect
.
assert_called_with
((
'1.2.3.4'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
sock
.
family
=
socket
.
AF_INET6
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'::2'
,
80
)
self
.
loop
.
run_until_complete
(
coro
)
sock
.
connect
.
assert_called_with
((
'::2'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET6
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
coro
=
self
.
loop
.
create_connection
(
asyncio
.
Protocol
,
'::2'
,
80
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
sock
.
connect
.
assert_called_with
((
'::2'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET6
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
@
patch_socket
def
test_create_connection_ip_addr
(
self
,
m_socket
):
...
...
@@ -1559,11 +1566,15 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
reuse_address
=
False
,
reuse_port
=
reuseport_supported
)
self
.
loop
.
run_until_complete
(
coro
)
bind
.
assert_called_with
((
'1.2.3.4'
,
0
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_UDP
,
type
=
m_socket
.
SOCK_DGRAM
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
bind
.
assert_called_with
((
'1.2.3.4'
,
0
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_UDP
,
type
=
m_socket
.
SOCK_DGRAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
def
test_accept_connection_retry
(
self
):
sock
=
mock
.
Mock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment