bpo-35565: Add detail to assertion failure message in wsgiref (GH-11293)

This commit is contained in:
Cheryl Sabella 2018-12-25 18:19:11 -05:00 committed by Raymond Hettinger
parent 32d96a2b5b
commit 5ef4fc241a
2 changed files with 15 additions and 1 deletions

View file

@ -193,6 +193,19 @@ class IntegrationTests(TestCase):
))
self.assertEqual(err.splitlines()[-2], exc_message)
@unittest.skipIf(support.python_is_optimized(),
"Python was compiled with optimizations")
def test_hop_by_hop_validation_error(self):
def bad_app(environ, start_response):
start_response("200 OK", [('Content-Type', 'text/plain'),
('Connection', 'close')])
return ["Hello, world!"]
out, err = run_amock(bad_app)
self.assertTrue(out.endswith(
b"A server error occurred. Please contact the administrator."
))
self.assertRaises(AssertionError)
def test_wsgi_input(self):
def bad_app(e,s):
e["wsgi.input"].read()