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
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/