MCPcopy Index your code
hub / github.com/python/cpython / test_simple_validation_error

Method test_simple_validation_error

Lib/test/test_wsgiref.py:147–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self.check_hello(out, has_length=False)
146
147 def test_simple_validation_error(self):
148 def bad_app(environ,start_response):
149 start_response("200 OK", ('Content-Type','text/plain'))
150 return ["Hello, world!"]
151 out, err = run_amock(validator(bad_app))
152 self.assertEndsWith(out,
153 b"A server error occurred. Please contact the administrator."
154 )
155 self.assertEqual(
156 err.splitlines()[-2],
157 "AssertionError: Headers (('Content-Type', 'text/plain')) must"
158 " be of type list: <class 'tuple'>"
159 )
160
161 def test_status_validation_errors(self):
162 def create_bad_app(status):

Callers

nothing calls this directly

Calls 5

validatorFunction · 0.90
run_amockFunction · 0.85
assertEndsWithMethod · 0.80
assertEqualMethod · 0.45
splitlinesMethod · 0.45

Tested by

no test coverage detected