def check_response(self, status=None):
__tracebackhide__ = True<EOL>res = self.response<EOL>full_status = "<STR_LIT>" % (res.status_code, res.reason)<EOL>content_length = int(res.headers.get("<STR_LIT>", <NUM_LIT:0>))<EOL>if content_length and len(res.content) != content_length:<EOL><INDENT>raise AppError(<EOL>"<STR_LIT>"<EOL>% (content_length, len(res.content))<EOL>)<EOL><DEDENT>if status == "<STR_LIT:*>":<EOL><INDENT>return<EOL><DEDENT>if isinstance(status, (list, tuple)):<EOL><INDENT>if res.status_code not in status:<EOL><INDENT>raise AppError(<EOL>"<STR_LIT>".format(<EOL>full_status,<EOL>"<STR_LIT:U+002CU+0020>".join(map(str, status)),<EOL>self.request["<STR_LIT>"],<EOL>self.request["<STR_LIT:path>"],<EOL>res.content,<EOL>)<EOL>)<EOL><DEDENT>return<EOL><DEDENT>if status is None:<EOL><INDENT>if res.status_code >= <NUM_LIT:200> and res.status_code < <NUM_LIT>:<EOL><INDENT>return<EOL><DEDENT>raise AssertionError(<EOL>"<STR_LIT>".format(<EOL>full_status,<EOL>self.request["<STR_LIT>"],<EOL>self.request["<STR_LIT:path>"],<EOL>res.content,<EOL>)<EOL>)<EOL><DEDENT>if status != res.status_code:<EOL><INDENT>raise AppError("<STR_LIT>" % (full_status, status))<EOL><DEDENT>
Raise an error, if self.response doesn"t match expected status.

        Inspired by paste.fixture