(self)
| 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): |
nothing calls this directly
no test coverage detected