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
905b76db
Commit
905b76db
authored
Mar 31, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add TestInputIter and TestInputReadlines to wsgi_test.py
parent
41a942a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
greentest/wsgi_test.py
greentest/wsgi_test.py
+24
-0
No files found.
greentest/wsgi_test.py
View file @
905b76db
...
...
@@ -463,6 +463,30 @@ class TestInputReadline(TestCase):
self
.
assertEqual
(
body
,
"'hello
\
\
n' '
\
\
n' 'world
\
\
n' '123' "
)
class
TestInputIter
(
TestInputReadline
):
def
application
(
self
,
environ
,
start_response
):
input
=
environ
[
'wsgi.input'
]
lines
=
[]
assert
hasattr
(
input
,
'next'
),
'wsgi.input does not have next() method'
for
line
in
input
:
if
not
line
:
break
lines
.
append
(
repr
(
line
)
+
' '
)
start_response
(
'200 hello'
,
[])
return
lines
class
TestInputReadlines
(
TestInputReadline
):
def
application
(
self
,
environ
,
start_response
):
input
=
environ
[
'wsgi.input'
]
lines
=
input
.
readlines
()
lines
=
[
repr
(
line
)
+
' '
for
line
in
lines
]
start_response
(
'200 hello'
,
[])
return
lines
class
HTTPRequest
(
urllib2
.
Request
):
"""Hack urllib2.Request to support PUT and DELETE methods."""
...
...
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