[FIX] base_module_quality: unit test if test has problem it will make exception in detail now

bzr revid: mra@tinyerp.com-20091028064945-0n8mwf2fxm01whn1
This commit is contained in:
mra (Open ERP) 2009-10-28 12:19:45 +05:30
parent 8b9eba5ea9
commit 8ce1c02da0
1 changed files with 5 additions and 6 deletions

View File

@ -94,21 +94,20 @@ This test checks the Unit Test(PyUnit) Cases of the module. Note that 'unit_test
res = detail + html + '</table></body></html>'
return res
else:
detail_lst = []
cnt = 0
detail_dict = {}
detail += '''<th class="tdatastyle">Details</th></tr>'''
data = data_list[1].split("======================================================================")
test = data[0].split('\n')
for err in (data_list[0].failures,data_list[0].errors):
for value in err:
detail_lst.append(value[1])
detail_dict[value[0]._testMethodName] = value[1]
for case in map(lambda x:x.split('...'), test):
if len(case[0]) < 2:
continue
test_name = case[0].split(' (')[0]
html += '<tr><th class="tdatastyle">%s</th><th class="tdatastyle">%s</th><td class="tdatastyle">%s</td></tr>'%(test_name,case[1],detail_lst[cnt])
cnt += 1
if not detail_dict.has_key(test_name):
detail_dict[test_name] = ''
html += '<tr><th class="tdatastyle">%s</th><th class="tdatastyle">%s</th><td class="tdatastyle">%s</td></tr>'%(test_name, case[1], detail_dict[test_name])
return detail + html +'</tr></table></body></html>'
return ''