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
1888f023
Commit
1888f023
authored
Jan 22, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsgi_test.py: rename test_002_keepalive to test_002_pipeline and fix it to fail
parent
5098521a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
greentest/wsgi_test.py
greentest/wsgi_test.py
+12
-14
No files found.
greentest/wsgi_test.py
View file @
1888f023
...
...
@@ -144,23 +144,21 @@ class TestHttpdBasic(TestCase):
self
.
assert_
(
result
.
startswith
(
'HTTP/1.1 200 OK
\
r
\
n
'
),
result
)
self
.
assert_
(
result
.
endswith
(
'hello world'
),
result
)
def
test_002_keepalive
(
self
):
fd
=
socket
.
connect_tcp
((
'127.0.0.1'
,
self
.
port
)).
makefile
(
bufsize
=
1
)
fd
.
write
(
'GET / HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
)
fd
.
write
(
'GET /notexist HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
)
fd
.
close
()
def
test_0021_keepalive
(
self
):
fd
=
socket
.
connect_tcp
((
'127.0.0.1'
,
self
.
port
)).
makefile
(
bufsize
=
1
)
fd
.
write
(
'GET / HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
)
fd
.
write
(
'GET /notexist HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
)
def
test_002_pipeline
(
self
):
fd
=
self
.
connect
().
makefile
(
bufsize
=
1
)
fd
.
write
(
'GET / HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
+
'GET /notexist HTTP/1.1
\
r
\
n
Host: localhost
\
r
\
n
\
r
\
n
'
)
firstline
,
headers
,
body
=
read_http
(
fd
)
assert
firstline
==
'HTTP/1.1 200 OK
\
r
\
n
'
,
repr
(
firstline
)
assert
body
==
'hello world'
,
repr
(
body
)
firstline
,
header
,
body
=
read_http
(
fd
)
assert
firstline
==
'HTTP/1.1 404 Not Found
\
r
\
n
'
,
repr
(
firstline
)
assert
body
==
'not found'
,
repr
(
body
)
fd
.
close
()
exception
=
AssertionError
(
'HTTP pipelining not supported; the second request is thrown away'
)
timeout
=
gevent
.
Timeout
.
start_new
(
0.5
,
exception
=
exception
)
try
:
firstline
,
header
,
body
=
read_http
(
fd
)
assert
firstline
==
'HTTP/1.1 404 Not Found
\
r
\
n
'
,
repr
(
firstline
)
assert
body
==
'not found'
,
repr
(
body
)
fd
.
close
()
finally
:
timeout
.
cancel
()
def
test_003_passing_non_int_to_read
(
self
):
# This should go in greenio_test
...
...
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