(status)
| 370 | % (wsgi_errors, attr)) |
| 371 | |
| 372 | def check_status(status): |
| 373 | status = check_string_type(status, "Status") |
| 374 | # Implicitly check that we can turn it into an integer: |
| 375 | status_code = status.split(None, 1)[0] |
| 376 | assert_(len(status_code) == 3, |
| 377 | "Status codes must be three characters: %r" % status_code) |
| 378 | status_int = int(status_code) |
| 379 | assert_(status_int >= 100, "Status code is invalid: %r" % status_int) |
| 380 | if len(status) < 4 or status[3] != ' ': |
| 381 | warnings.warn( |
| 382 | "The status string (%r) should be a three-digit integer " |
| 383 | "followed by a single space and a status explanation" |
| 384 | % status, WSGIWarning) |
| 385 | |
| 386 | def check_headers(headers): |
| 387 | assert_(type(headers) is list, |
no test coverage detected
searching dependent graphs…