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
41a942a6
Commit
41a942a6
authored
Mar 31, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add TestClientCloses to test__http.py
parent
189b5f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
greentest/test__http.py
greentest/test__http.py
+19
-0
No files found.
greentest/test__http.py
View file @
41a942a6
...
...
@@ -64,6 +64,25 @@ class BoundTestCase(greentest.TestCase):
print
'WARNING: instead of ECONNREFUSED got IOError: %s'
%
e
class
TestClientCloses
(
BoundTestCase
):
spawn
=
True
def
handle
(
self
,
r
):
self
.
log
.
append
(
'reply'
)
gevent
.
sleep
(
0.1
)
r
.
send_reply
(
200
,
'OK'
,
'hello world'
)
# QQQ should I get an exception here because the connection is closed?
self
.
log
.
append
(
'reply_done'
)
def
test
(
self
):
self
.
log
=
[
'hey'
]
s
=
self
.
connect
()
s
.
sendall
(
'GET / HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
Content-Length: 100
\
r
\
n
\
r
\
n
'
)
s
.
close
()
gevent
.
sleep
(
0.2
)
self
.
assertEqual
(
self
.
log
,
[
'hey'
,
'reply'
,
'reply_done'
])
class
TestStop
(
BoundTestCase
):
# this triggers if connection_closed is not handled properly
...
...
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