Commit 3754ea59 by taoke

信用权益excle修改

parent 1af403e2
......@@ -19,6 +19,17 @@ headers['Token'] = BMCConfig.bmc_token
@allure.epic("信用权益")
class TestCreditRight():
workBook = xlrd.open_workbook(f'{BaseConfig.root_path}/test_case_data/bmc/bmc_credit_right_2021513.xlsx')
def setup_class(self):
noActiveheaders = {
'City-Code': "520100",'Device-Brand': "vivo",'Device-Code': "000000001e167ed7000000001e167ed7",'Device-Model': "vivo vivo X20",'Device-Name': "vivo+X20",'Device-Type': "Android",'Mac': "38:6E:A2:A0:0E:AF",'mimeType': "application/json",'Net': "wifi",'OS-Type': "Android",'OS-Version': "27",'Resolution': "2034x1080",'Version': "2.2.6",
'Pvt-Token': "", 'Token': "",
}
indata = {"phone": f"{BMCConfig.NoactivePhone}",
"encodedGesture": "67e6d10010533eed4bbe9659863bf6ee"}
res = BMC().bmc_login(indata)
noActiveheaders['Pvt-Token'] = res[1]
noActiveheaders['Token'] = res[0]
@allure.story("未激活用户信用权益获取")
@allure.link('http://yapi.hikcreate.com/project/31/interface/api/74396', name='点我看接口文档')
......@@ -26,14 +37,21 @@ class TestCreditRight():
@allure.title("{inData[testPoint]}")
@pytest.mark.parametrize("inData", get_excelData(workBook, '信用权益', 'creditRightIndex'))
def test_creditRightIndex(self, inData):
# url = f"{BMCConfig().pvthost}{inData['url']}"
# method = inData['method']
# req_data = inData['reqData']
# expectData = inData['expectData']
# headers = inData['headers']
# """请求"""
# res = request_main(url, headers, method, req_data)
# """断言"""
# assert res['code'] == expectData['code']
pass
url = f"{BMCConfig().host}{inData['url']}"
method = inData['method']
req_data = inData['reqData']
expectData = inData['expectData']
headers = inData['headers']
"""请求"""
res = request_main(url, headers, method, req_data)
print(res)
"""断言"""
assert res['code'] == expectData['code']
if __name__ == '__main__':
for one in os.listdir('../../report/tmp'): # 列出对应文件夹的数据 '-m','scoreDetail' ,
if 'json' in one:
os.remove(f'../../report/tmp/{one}')
pytest.main(['test_creditRight.py', '-s', '--alluredir','../../report/tmp'])
# 启动默认浏览器打开报告
os.system('allure serve ../../report/tmp')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment