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
e3ce448e
Commit
e3ce448e
authored
Apr 08, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsgi_test.py: print the data received from the server if -v is passed
parent
f46c94e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
greentest/wsgi_test.py
greentest/wsgi_test.py
+30
-0
No files found.
greentest/wsgi_test.py
View file @
e3ce448e
...
...
@@ -24,6 +24,7 @@ monkey.patch_all(thread=False)
import
cgi
import
os
import
urllib2
import
sys
try
:
from
wsgiref.validate
import
validator
except
ImportError
:
...
...
@@ -39,6 +40,7 @@ from gevent import socket
CONTENT_LENGTH
=
'Content-Length'
CONN_ABORTED_ERRORS
=
[]
server_implements_chunked
=
True
DEBUG
=
'-v'
in
sys
.
argv
try
:
from
errno
import
WSAECONNABORTED
...
...
@@ -163,6 +165,34 @@ class Response(object):
read_http
=
Response
.
read
class
DebugFileObject
(
object
):
def
__init__
(
self
,
obj
):
self
.
obj
=
obj
def
read
(
self
,
*
args
):
result
=
self
.
obj
.
read
(
*
args
)
if
DEBUG
:
print
repr
(
result
)
return
result
def
readline
(
self
,
*
args
):
result
=
self
.
obj
.
readline
(
*
args
)
if
DEBUG
:
print
repr
(
result
)
return
result
def
__getattr__
(
self
,
item
):
assert
item
!=
'obj'
return
getattr
(
self
.
obj
,
item
)
def
makefile
(
self
,
mode
=
'r'
,
bufsize
=-
1
):
return
DebugFileObject
(
socket
.
_fileobject
(
self
.
dup
(),
mode
,
bufsize
))
socket
.
socket
.
makefile
=
makefile
class
TestCase
(
greentest
.
TestCase
):
def
get_wsgi_module
(
self
):
...
...
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