Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
0b2a6f95
Commit
0b2a6f95
authored
Jul 12, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 3.7 tests to latest version.
parent
8bc49537
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
63 deletions
+130
-63
src/greentest/3.7/test_ftplib.py
src/greentest/3.7/test_ftplib.py
+3
-7
src/greentest/3.7/test_selectors.py
src/greentest/3.7/test_selectors.py
+8
-1
src/greentest/3.7/test_socket.py
src/greentest/3.7/test_socket.py
+1
-1
src/greentest/3.7/test_ssl.py
src/greentest/3.7/test_ssl.py
+95
-46
src/greentest/3.7/test_subprocess.py
src/greentest/3.7/test_subprocess.py
+22
-7
src/greentest/3.7/version
src/greentest/3.7/version
+1
-1
No files found.
src/greentest/3.7/test_ftplib.py
View file @
0b2a6f95
...
...
@@ -257,6 +257,7 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
def
__init__
(
self
,
address
,
af
=
socket
.
AF_INET
):
threading
.
Thread
.
__init__
(
self
)
asyncore
.
dispatcher
.
__init__
(
self
)
self
.
daemon
=
True
self
.
create_socket
(
af
,
socket
.
SOCK_STREAM
)
self
.
bind
(
address
)
self
.
listen
(
5
)
...
...
@@ -312,8 +313,6 @@ if ssl is not None:
def
secure_connection
(
self
):
context
=
ssl
.
SSLContext
()
# TODO: fix TLSv1.3 support
context
.
options
|=
ssl
.
OP_NO_TLSv1_3
context
.
load_cert_chain
(
CERTFILE
)
socket
=
context
.
wrap_socket
(
self
.
socket
,
suppress_ragged_eofs
=
False
,
...
...
@@ -405,7 +404,7 @@ if ssl is not None:
def
close
(
self
):
if
(
isinstance
(
self
.
socket
,
ssl
.
SSLSocket
)
and
self
.
socket
.
_sslobj
is
not
None
):
self
.
socket
.
_sslobj
is
not
None
):
self
.
_do_ssl_shutdown
()
else
:
super
(
SSLConnection
,
self
).
close
()
...
...
@@ -910,8 +909,6 @@ class TestTLS_FTPClass(TestCase):
def
test_context
(
self
):
self
.
client
.
quit
()
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLS_CLIENT
)
# TODO: fix TLSv1.3 support
ctx
.
options
|=
ssl
.
OP_NO_TLSv1_3
ctx
.
check_hostname
=
False
ctx
.
verify_mode
=
ssl
.
CERT_NONE
self
.
assertRaises
(
ValueError
,
ftplib
.
FTP_TLS
,
keyfile
=
CERTFILE
,
...
...
@@ -944,8 +941,6 @@ class TestTLS_FTPClass(TestCase):
def
test_check_hostname
(
self
):
self
.
client
.
quit
()
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLS_CLIENT
)
# TODO: fix TLSv1.3 support
ctx
.
options
|=
ssl
.
OP_NO_TLSv1_3
self
.
assertEqual
(
ctx
.
verify_mode
,
ssl
.
CERT_REQUIRED
)
self
.
assertEqual
(
ctx
.
check_hostname
,
True
)
ctx
.
load_verify_locations
(
CAFILE
)
...
...
@@ -982,6 +977,7 @@ class TestTimeouts(TestCase):
self
.
sock
.
settimeout
(
20
)
self
.
port
=
support
.
bind_port
(
self
.
sock
)
self
.
server_thread
=
threading
.
Thread
(
target
=
self
.
server
)
self
.
server_thread
.
daemon
=
True
self
.
server_thread
.
start
()
# Wait for the server to be ready.
self
.
evt
.
wait
()
...
...
src/greentest/3.7/test_selectors.py
View file @
0b2a6f95
...
...
@@ -481,7 +481,14 @@ class ScalableSelectorMixIn:
self
.
skipTest
(
"FD limit reached"
)
raise
self
.
assertEqual
(
NUM_FDS
//
2
,
len
(
s
.
select
()))
try
:
fds
=
s
.
select
()
except
OSError
as
e
:
if
e
.
errno
==
errno
.
EINVAL
and
sys
.
platform
==
'darwin'
:
# unexplainable errors on macOS don't need to fail the test
self
.
skipTest
(
"Invalid argument error calling poll()"
)
raise
self
.
assertEqual
(
NUM_FDS
//
2
,
len
(
fds
))
class
DefaultSelectorTestCase
(
BaseSelectorTestCase
):
...
...
src/greentest/3.7/test_socket.py
View file @
0b2a6f95
...
...
@@ -893,7 +893,7 @@ class GeneralModuleTests(unittest.TestCase):
)
for
addr
in
[
'0.1.1.~1'
,
'1+.1.1.1'
,
'::1q'
,
'::1::2'
,
'1:1:1:1:1:1:1:1:1'
]:
with
self
.
assertRaises
(
OSError
):
with
self
.
assertRaises
(
OSError
,
msg
=
addr
):
socket
.
gethostbyname
(
addr
)
with
self
.
assertRaises
(
OSError
,
msg
=
explanation
):
socket
.
gethostbyaddr
(
addr
)
...
...
src/greentest/3.7/test_ssl.py
View file @
0b2a6f95
This diff is collapsed.
Click to expand it.
src/greentest/3.7/test_subprocess.py
View file @
0b2a6f95
...
...
@@ -1617,13 +1617,29 @@ class POSIXProcessTestCase(BaseTestCase):
self
.
assertIn
(
repr
(
error_data
),
str
(
e
.
exception
))
@
unittest
.
skipIf
(
not
os
.
path
.
exists
(
'/proc/self/status'
),
"need /proc/self/status"
)
def
test_restore_signals
(
self
):
# Code coverage for both values of restore_signals to make sure it
# at least does not blow up.
# A test for behavior would be complex. Contributions welcome.
subprocess
.
call
([
sys
.
executable
,
"-c"
,
""
],
restore_signals
=
True
)
subprocess
.
call
([
sys
.
executable
,
"-c"
,
""
],
restore_signals
=
False
)
# Blindly assume that cat exists on systems with /proc/self/status...
default_proc_status
=
subprocess
.
check_output
(
[
'cat'
,
'/proc/self/status'
],
restore_signals
=
False
)
for
line
in
default_proc_status
.
splitlines
():
if
line
.
startswith
(
b'SigIgn'
):
default_sig_ign_mask
=
line
break
else
:
self
.
skipTest
(
"SigIgn not found in /proc/self/status."
)
restored_proc_status
=
subprocess
.
check_output
(
[
'cat'
,
'/proc/self/status'
],
restore_signals
=
True
)
for
line
in
restored_proc_status
.
splitlines
():
if
line
.
startswith
(
b'SigIgn'
):
restored_sig_ign_mask
=
line
break
self
.
assertNotEqual
(
default_sig_ign_mask
,
restored_sig_ign_mask
,
msg
=
"restore_signals=True should've unblocked "
"SIGPIPE and friends."
)
def
test_start_new_session
(
self
):
# For code coverage of calling setsid(). We don't care if we get an
...
...
@@ -2174,7 +2190,6 @@ class POSIXProcessTestCase(BaseTestCase):
to descriptor(s)
{
read_fds
}
instead of descriptor
{
to_fd
}
.
"""
)
self
.
assertEqual
([
to_fd
],
read_fds
,
msg
)
finally
:
self
.
_restore_fds
(
saved_fds
)
...
...
src/greentest/3.7/version
View file @
0b2a6f95
3.7.0
b4
3.7.0
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