Fix KeyError when test_servers_get fails.
Updates the integrated.test_api_samples.ServersSampleAllExtensionXmlTest test_servers_get function so that it doesn't try to list the line number when the test fails. Fixes a KeyError: '\'i\' exceptions. Partial fix for LP Bug #1042709. Change-Id: I666d18c1d4585cebce4534b1f16cd327850e8cdc
This commit is contained in:
parent
458ee2eac0
commit
f3c594a9b8
@ -100,10 +100,10 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
try:
|
try:
|
||||||
match = re.match(line, result_line)
|
match = re.match(line, result_line)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.fail(_('Response error on line %(i)s:\n'
|
self.fail(_('Response error on line:\n'
|
||||||
'%(line)s\n%(result_line)s') % locals())
|
'%(line)s\n%(result_line)s') % locals())
|
||||||
if not match:
|
if not match:
|
||||||
self.fail(_('Response error on line %(i)s:\n'
|
self.fail(_('Response error on line:\n'
|
||||||
'%(line)s\n%(result_line)s') % locals())
|
'%(line)s\n%(result_line)s') % locals())
|
||||||
if match.groups():
|
if match.groups():
|
||||||
result = match.groups()[0]
|
result = match.groups()[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user