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
b4dcad91
Commit
b4dcad91
authored
Sep 13, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsgi2_test.py: add test for Internal Server Error
parent
6de81586
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
greentest/wsgi2_test.py
greentest/wsgi2_test.py
+30
-0
No files found.
greentest/wsgi2_test.py
View file @
b4dcad91
...
...
@@ -6,5 +6,35 @@ del TestHttps, TestChunkedApp, TestBigChunks
TestCase
.
get_wsgi_module
=
lambda
*
args
:
wsgi2
class
Expected
(
Exception
):
pass
class
TestError
(
TestCase
):
@
staticmethod
def
application
(
env
,
start_response
):
raise
Expected
@
property
def
url
(
self
):
return
'http://127.0.0.1:%s'
%
self
.
port
def
test
(
self
):
try
:
r
=
urllib2
.
urlopen
(
self
.
url
)
raise
AssertionError
(
'Must raise HTTPError, returned %r: %s'
%
(
r
,
r
.
code
))
except
urllib2
.
HTTPError
,
ex
:
assert
ex
.
code
==
500
,
ex
assert
ex
.
msg
==
'Internal Server Error'
,
ex
class
TestError_after_start_response
(
TestError
):
@
staticmethod
def
application
(
env
,
start_response
):
start_response
(
'200 OK'
,
[(
'Content-Type'
,
'text/plain'
)])
raise
Expected
if
__name__
==
'__main__'
:
greentest
.
main
()
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