pytest.main(["-v","test_1214.py"])
# -*- coding: utf-8 -*-
import pytest
import requests
def test_agent():
r = requests.post(
url="http://127.0.0.1:9000/get_user",
data={
"name": "吴磊",
"sex": 1
},
headers={"Content-Type": "application/json"}
)
print(r.text)
assert r.json()['data']['retCode'] == "00" and r.json()['data']['retMsg'] == "调用成功"
if __name__ == "__main__":
pytest.main(["-v","test_api.py"])
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |