Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
2d0f0209
Commit
2d0f0209
authored
Jun 22, 2010
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added at least one unit test for the 'exception' method
parent
64aebc0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
src/ZPublisher/tests/testHTTPResponse.py
src/ZPublisher/tests/testHTTPResponse.py
+19
-1
No files found.
src/ZPublisher/tests/testHTTPResponse.py
View file @
2d0f0209
# -*- coding: iso-8859-15 -*-
import
unittest
import
sys
class
HTTPResponseTests
(
unittest
.
TestCase
):
...
...
@@ -25,7 +27,6 @@ class HTTPResponseTests(unittest.TestCase):
return
self
.
_getTargetClass
()(
*
args
,
**
kw
)
def
test_ctor_defaults
(
self
):
import
sys
response
=
self
.
_makeOne
()
self
.
assertEqual
(
response
.
accumulated_headers
,
[])
self
.
assertEqual
(
response
.
status
,
200
)
...
...
@@ -1279,6 +1280,23 @@ class HTTPResponseTests(unittest.TestCase):
self
.
assertEqual
(
len
(
lines
),
1
)
self
.
assertEqual
(
lines
[
0
],
'Kilroy was here!'
)
def
test_exception_Internal_Server_Error
(
self
):
response
=
self
.
_makeOne
()
try
:
raise
AttributeError
(
'ERROR VALUE'
)
except
AttributeError
:
body
=
response
.
exception
()
self
.
failUnless
(
'ERROR VALUE'
in
str
(
body
))
self
.
assertEqual
(
response
.
status
,
500
)
self
.
assertEqual
(
response
.
errmsg
,
'Internal Server Error'
)
# required by Bobo Call Interface (BCI)
self
.
assertEqual
(
response
.
headers
[
'bobo-exception-type'
],
"<type 'exceptions.AttributeError'>"
)
self
.
assertEqual
(
response
.
headers
[
'bobo-exception-value'
],
'See the server error log for details'
)
self
.
failUnless
(
'bobo-exception-file'
in
response
.
headers
)
self
.
failUnless
(
'bobo-exception-line'
in
response
.
headers
)
#TODO
# def test_exception_* WAAAAAA!
...
...
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