summaryrefslogtreecommitdiff
path: root/tests/test_exceptions
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-03-26 02:17:04 +0000
committerianb <devnull@localhost>2008-03-26 02:17:04 +0000
commitaed98f824bb54253b9d17ece819e965c532beea4 (patch)
tree7473f3b66650d5ee7bb224d9c939079823937f1f /tests/test_exceptions
parent3bd39f08a20e2231fec8496244833ea960603423 (diff)
downloadpaste-aed98f824bb54253b9d17ece819e965c532beea4.tar.gz
Fix #240, unicode exceptions cause collector to fail. Also make tests somewhat less fragile
Diffstat (limited to 'tests/test_exceptions')
-rw-r--r--tests/test_exceptions/test_error_middleware.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_exceptions/test_error_middleware.py b/tests/test_exceptions/test_error_middleware.py
index 064f909..a34de73 100644
--- a/tests/test_exceptions/test_error_middleware.py
+++ b/tests/test_exceptions/test_error_middleware.py
@@ -44,6 +44,9 @@ def bad_app():
"No argument list!"
return None
+def unicode_bad_app(environ, start_response):
+ raise ValueError(u"\u1000")
+
def start_response_app(environ, start_response):
"raise error before start_response"
raise ValueError("hi")
@@ -76,20 +79,22 @@ def test_makes_exception():
assert 'paste.lint' in res
assert 'paste.exceptions.errormiddleware' in res
+def test_unicode_exception():
+ res = do_request(unicode_bad_app)
+
+
def test_start_res():
res = do_request(start_response_app)
res = strip_html(str(res))
- #print res
assert 'ValueError: hi' in res
assert 'test_error_middleware' in res
- assert ':49 in start_response_app' in res
+ assert ':52 in start_response_app' in res
def test_after_start():
res = do_request(after_start_response_app, 200)
res = strip_html(str(res))
#print res
assert 'ValueError: error2' in res
- assert ':53' in res
def test_iter_app():
res = do_request(lint.middleware(iter_app), 200)