对代码进行调整
This commit is contained in:
@@ -17,8 +17,8 @@ def datacel(filepath):
|
||||
listkey = []
|
||||
listconeent = []
|
||||
listurl = []
|
||||
listfangshi = []
|
||||
listqiwang = []
|
||||
listmethod = []
|
||||
listassert = []
|
||||
listname = []
|
||||
for i in range(1, nrows):
|
||||
listid.append(rslut.cell(i, 0).value)
|
||||
@@ -26,9 +26,9 @@ def datacel(filepath):
|
||||
listconeent.append(rslut.cell(i, 3).value)
|
||||
listurl.append(rslut.cell(i, 4).value)
|
||||
listname.append(rslut.cell(i, 1).value)
|
||||
listfangshi.append((rslut.cell(i, 5).value))
|
||||
listqiwang.append((rslut.cell(i, 6).value))
|
||||
return listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname
|
||||
listmethod.append((rslut.cell(i, 5).value))
|
||||
listassert.append((rslut.cell(i, 6).value))
|
||||
return listid, listkey, listconeent, listurl, listmethod, listassert, listname
|
||||
except Exception as e:
|
||||
print(e)
|
||||
LOG.info('打开测试用例失败,原因是:%s' % e)
|
||||
@@ -38,13 +38,12 @@ def datacel(filepath):
|
||||
@logger('生成数据驱动所用数据')
|
||||
def makedata():
|
||||
path = os.path.join(os.path.join(os.getcwd(), 'test_case_data'), 'case.xlsx')
|
||||
listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel(path)
|
||||
|
||||
listid, listkey, listconeent, listurl, listmethod, listassert, listname = datacel(path)
|
||||
make_data = []
|
||||
for i in range(len(listid)):
|
||||
make_data.append({'url': listurl[i], 'key': listkey[i],
|
||||
'coneent': listconeent[i], 'fangshi': listfangshi[i],
|
||||
'qiwang': listqiwang[i],
|
||||
'coneent': listconeent[i], 'fangshi': listmethod[i],
|
||||
'qiwang': listassert[i],
|
||||
'id': listid[i]},
|
||||
)
|
||||
i += 1
|
||||
|
||||
Reference in New Issue
Block a user