Commit 3c9c6d71 authored by Denis Bilenko's avatar Denis Bilenko

test__pywsgi: make assertCode accept a list of codes

parent 24685bcf
......@@ -117,7 +117,10 @@ class Response(object):
return '<%s status_line=%r headers=%r body=%r chunks=%r>' % args
def assertCode(self, code):
assert self.code == code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self)
if hasattr(code, '__contains__'):
assert self.code in code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self)
else:
assert self.code == code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self)
def assertReason(self, reason):
assert self.reason == reason, 'Unexpected reason: %r (expected %r)\n%s' % (self.reason, reason, self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment