Merge "Provide a better error when _verify_response hits a TypeError"
This commit is contained in:
@@ -245,7 +245,15 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
|
|
||||||
expected = expected % self.subs
|
expected = expected % self.subs
|
||||||
expected = '^%s$' % expected
|
expected = '^%s$' % expected
|
||||||
|
try:
|
||||||
match = re.match(expected, result)
|
match = re.match(expected, result)
|
||||||
|
except TypeError as e:
|
||||||
|
raise NoMatch(
|
||||||
|
'Values do not match:\n'
|
||||||
|
'Template: %(expected)s\n%(result_str)s: %(result)s\n'
|
||||||
|
'Error: %(error)s' %
|
||||||
|
{'expected': expected, 'result_str': result_str,
|
||||||
|
'result': result, 'error': e})
|
||||||
if not match:
|
if not match:
|
||||||
raise NoMatch(
|
raise NoMatch(
|
||||||
'Values do not match:\n'
|
'Values do not match:\n'
|
||||||
|
Reference in New Issue
Block a user