ant; WORD-BREAK: break-all">def check_item(excelobj, suiteid, caseid,real_dict, checklist, begincol):
ret='OK'
for checkid in range(0, len(checklist)):
real=real_dict[checklist[checkid]]['value']
expect=excelobj.read_data(suiteid, excelobj.casebegin+caseid, begincol+checkid)
#如果检查不一致测将实际结果写入expect字段,格式:expect[real]
#将return NG
result=assert_result(real, expect)
if result=='NG':
writestr=expect+'['+real+']'
excelobj.write_data(suiteid, excelobj.casebegin+caseid, begincol+checkid, writestr, NG_COLOR)
ret='NG'
return ret
#检查结构体类型
def check_struct_item(excelobj, suiteid, caseid,real_struct_dict, structlist, structbegin, structcount):
ret='OK'
if structcount>1: #传入的是List
for structid in range(0, structcount):
structdict=real_struct_dict[structid]
temp=check_item(excelobj, suiteid, caseid,structdict, structlist, structbegin+structid*len(structlist))
if temp=='NG':
ret='NG'
else: #传入的是Dict
temp=check_item(excelobj, suiteid, caseid,real_struct_dict, structlist, structbegin)
if temp=='NG':
ret='NG'
return ret
#获取异常函数及行号
def print_error_info():
"""Return the frame. object for the caller's stack frame."""
try:
raise Exception
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/