Commit cd63ae7f by 文鑫

修改代码

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