34 lines
897 B
Python
34 lines
897 B
Python
import requests
|
|
import allure
|
|
from config.readConfig import ReadConfig
|
|
rc = ReadConfig()
|
|
from project_path import path
|
|
file = {"file":open(file=path+"\\testFile\\emoji.JPG",mode="rb")}
|
|
|
|
@allure.feature("CRM-上传头像功能链路测试")
|
|
class TestDemo3():
|
|
@allure.severity(allure.severity_level.BLOCKER)
|
|
@allure.title("上传头像")
|
|
@allure.story("上传头像:/system/user/updateImg")
|
|
def test_case_01(self, get_crm_token):
|
|
"""
|
|
上传头像接口:/system/user/updateImg
|
|
post
|
|
{userId:
|
|
3
|
|
file:
|
|
(binary)
|
|
}
|
|
|
|
{"code":
|
|
0}
|
|
"""
|
|
res = requests.post(url=rc.get_crmconfig()+'/system/user/updateImg',data={"userId":3},files=file,
|
|
headers=get_crm_token)
|
|
print(res.text)
|
|
assert res.status_code == 200
|
|
assert res.json()["code"] == 0
|
|
|
|
|
|
|