Commit cd63ae7f by 文鑫

修改代码

parent 01517f62
......@@ -10,14 +10,16 @@ from common.getData import DoExcelByPandas
@allure.feature('系统设置')
class TestSystem():
parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1')
@pytest.mark.parametrize('id,url,data,story,severity,condition,except_result',parametrize)
def test(self,id,url,data,story,severity,condition,except_result): # test开头的测试函数
@pytest.mark.parametrize('id,url,data,story,method,severity,condition,except_result',parametrize)
def test(self,id,url,data,story,method,severity,condition,except_result): # test开头的测试函数
headers = getHeader.get_Header()
url = url
json = eval(data)
r = requests.post(url = url,json = json,headers = headers)
response = r.json()
assert response[condition] == except_result # 断言成功
if method == 'post':
r = requests.post(url = url,json = json,headers = headers)
response = r.json()
assert response[condition] == except_result # 断言成功
......
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