import requests
import sys
import os
base_path=os.getcwd()
sys.path.append(base_path)
import unittest
from Base.base_request import request
url="http://14.17.12"
data={
"account":"360209841",
"LoginAgent":"WEB",
"password":"ssH7CgvA="
}
header= {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100",
"Host": "14.17.122.160:1908",
"Connection": "keep-alive",
"Content-Length": "228",
"Accept": "application/json, text/javascript, */*; q=0.01",
"Origin": "http://14.17.122.160:19080",
"Referer": "http://14.17.122.160:19080/login.html?v=0f7f",
"Accept-Encoding": "gzip, deflate"
}
class TestAssert(unittest.TestCase):
def test_01(self):
res=request.run_main(url,json=data,headers=header)
print(res)
'''res=requests.post(url,json=data,headers=header).text
print(res)'''
这是我test_02文件的所有内容 ,url和密码我给去了