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
583278fe
Commit
583278fe
authored
Jan 21, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__socket: make TestTCP.test_sendall_timeout good enough for TestSSL
parent
f6e5494a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
greentest/test__socket.py
greentest/test__socket.py
+14
-3
No files found.
greentest/test__socket.py
View file @
583278fe
...
...
@@ -57,15 +57,26 @@ class TestTCP(greentest.TestCase):
acceptor
.
get
()
def
test_sendall_timeout
(
self
):
acceptor
=
gevent
.
spawn_link_exception
(
self
.
listener
.
accept
)
client
=
self
.
create_connection
()
client
.
settimeout
(
0.
0
1
)
client
.
settimeout
(
0.1
)
start
=
time
.
time
()
send_succeed
=
False
data_sent
=
'h'
*
100000
try
:
result
=
client
.
sendall
(
'h'
*
100000
)
result
=
client
.
sendall
(
data_sent
)
except
socket
.
timeout
:
assert
0.1
-
0.01
<=
time
.
time
()
-
start
<=
0.1
+
0.1
,
(
time
.
time
()
-
start
)
else
:
raise
AssertionError
(
'socket.timeout should have been raised, instead sendall returned %r'
%
(
result
,
))
assert
time
.
time
()
-
start
<=
0.1
+
0.01
,
(
time
.
time
()
-
start
)
send_succeed
=
True
conn
,
addr
=
acceptor
.
get
()
if
send_succeed
:
client
.
close
()
data_read
=
conn
.
makefile
().
read
()
self
.
assertEqual
(
len
(
data_sent
),
len
(
data_read
))
self
.
assertEqual
(
data_sent
,
data_read
)
print
'WARNING: read the data instead of failing with timeout'
def
test_makefile
(
self
):
def
accept_once
():
...
...
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