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
bcf8afd0
Commit
bcf8afd0
authored
Dec 16, 2015
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.4
parents
e277a3dc
5f68ca66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
Lib/test/test_asyncio/test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+11
-7
Lib/test/test_asyncio/test_streams.py
Lib/test/test_asyncio/test_streams.py
+7
-6
No files found.
Lib/test/test_asyncio/test_base_events.py
View file @
bcf8afd0
...
...
@@ -127,23 +127,27 @@ class BaseEventTests(test_utils.TestCase):
def
test_check_resolved_address
(
self
):
sock
=
socket
.
socket
(
socket
.
AF_INET
)
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
with
sock
:
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
sock
=
socket
.
socket
(
socket
.
AF_INET6
)
base_events
.
_check_resolved_address
(
sock
,
(
'::3'
,
1
))
base_events
.
_check_resolved_address
(
sock
,
(
'::3%lo0'
,
1
))
self
.
assertRaises
(
ValueError
,
base_events
.
_check_resolved_address
,
sock
,
(
'foo'
,
1
))
with
sock
:
base_events
.
_check_resolved_address
(
sock
,
(
'::3'
,
1
))
base_events
.
_check_resolved_address
(
sock
,
(
'::3%lo0'
,
1
))
with
self
.
assertRaises
(
ValueError
):
base_events
.
_check_resolved_address
(
sock
,
(
'foo'
,
1
))
def
test_check_resolved_sock_type
(
self
):
# Ensure we ignore extra flags in sock.type.
if
hasattr
(
socket
,
'SOCK_NONBLOCK'
):
sock
=
socket
.
socket
(
type
=
socket
.
SOCK_STREAM
|
socket
.
SOCK_NONBLOCK
)
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
with
sock
:
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
if
hasattr
(
socket
,
'SOCK_CLOEXEC'
):
sock
=
socket
.
socket
(
type
=
socket
.
SOCK_STREAM
|
socket
.
SOCK_CLOEXEC
)
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
with
sock
:
base_events
.
_check_resolved_address
(
sock
,
(
'1.2.3.4'
,
1
))
class
BaseEventLoopTests
(
test_utils
.
TestCase
):
...
...
Lib/test/test_asyncio/test_streams.py
View file @
bcf8afd0
...
...
@@ -647,12 +647,13 @@ os.close(fd)
def
server
():
# Runs in a separate thread.
sock
=
socket
.
socket
()
sock
.
bind
((
'localhost'
,
0
))
sock
.
listen
(
1
)
addr
=
sock
.
getsockname
()
q
.
put
(
addr
)
clt
,
_
=
sock
.
accept
()
clt
.
close
()
with
sock
:
sock
.
bind
((
'localhost'
,
0
))
sock
.
listen
(
1
)
addr
=
sock
.
getsockname
()
q
.
put
(
addr
)
clt
,
_
=
sock
.
accept
()
clt
.
close
()
@
asyncio
.
coroutine
def
client
(
host
,
port
):
...
...
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