加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test_TermFinancial.py 26.31 KB
一键复制 编辑 原始数据 按行查看 历史
末日流光 提交于 2023-11-28 18:37 . 接口自动化测试
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
import unittest
from ddt import ddt,data,unpack
import requests
import Common
@ddt
class TermFinancialTest(unittest.TestCase):
test = "test"
finish = "finish"
testTxt = "测好了"
db=""
cursor=""
url="http://localhost:90/user/buyTermFinancial"
login_url="http://localhost:90/login/verifyLogin"
@classmethod
def setUpClass(self):
self.db,self.cursor=Common.connectMysql()
@classmethod
def tearDownClass(self):
Common.closeMysql(self.db,self.cursor)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":200,"code":100}])
def test_01_normal_user_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":123456},{"status":200,"code":200}])
def test_02_normal_errorPassWord_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":200,"code":300}])
def test_03_normal_NotPassWord_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
Common.clearPassWord(self.db,self.cursor,userId)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":200,"code":500}])
def test_04_normal_NotBankcard_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
Common.deleteALLBankCardByUserId(self.db,self.cursor,userId)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","count":10000,"balance":"1000000","termFinancialId":1,"passWord":666666},{"status":400,"code":""}])
def test_05_normal_MoreParams_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
count = values["count"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
params["count"] = values["count"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
self.assertEqual(targets["status"],status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":400,"code":""}])
def test_06_normal_lackUserId_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["termFinancialId"] = termFinancialId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
self.assertEqual(targets["status"],status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":400,"code":""}])
def test_07_normal_lacktermFinancialId_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["passWord"] = values["passWord"]
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
self.assertEqual(targets["status"],status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","balance":"1000000","termFinancialId":1,"passWord":666666},{"status":400,"code":""}])
def test_08_normal_lackPassWord_BuyChangeMoney(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
userId=Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)[0][0]
termFinancialId=values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
#检查银行卡余额
Common.checkBankCardBalance(self.db,self.cursor,userId,balance)
## 补齐个人信息
Common.checkUserDetail(self.db,self.cursor,Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2),user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
req=requests.post(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
self.assertEqual(targets["status"],status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"balance": "1000000", "termFinancialId": 1, "passWord": 666666}, {"status":400 , "code": ""}])
def test_09_normal_lackParams_BuyChangeMoney(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
userId = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)[0][0]
termFinancialId = values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
# 检查银行卡余额
Common.checkBankCardBalance(self.db, self.cursor, userId, balance)
## 补齐个人信息
Common.checkUserDetail(self.db, self.cursor,
Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2), user)
params = {}
req = requests.post(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
self.assertEqual(targets["status"], status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"balance": "1000000", "termFinancialId": 1, "passWord": 666666}, {"status": 400, "code": ""}])
def test_09_normal_lackParamsValue_BuyChangeMoney(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
userId = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)[0][0]
termFinancialId = values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
# 检查银行卡余额
Common.checkBankCardBalance(self.db, self.cursor, userId, balance)
## 补齐个人信息
Common.checkUserDetail(self.db, self.cursor,
Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2), user)
params = {}
params["userId"] = ""
params["termFinancialId"] = ""
params["passWord"] = ""
req = requests.post(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
self.assertEqual(targets["status"], status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"balance": "1000000", "termFinancialId": 1, "passWord": 666666}, {"status": 400, "code": ""}])
def test_10_normal_SqlInject_BuyChangeMoney(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
userId = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)[0][0]
termFinancialId = values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
# 检查银行卡余额
Common.checkBankCardBalance(self.db, self.cursor, userId, balance)
## 补齐个人信息
Common.checkUserDetail(self.db, self.cursor,
Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2), user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = str(values["passWord"]) +" ; drop table user;"
req = requests.post(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
self.assertEqual(targets["status"], status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"balance": "1000000", "termFinancialId": 1, "passWord": 666666}, {"status": 302, "code": ""}])
def test_11_normal_overstep_BuyChangeMoney(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
balance = values["balance"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, username, password, Common.generateRandomNumber(18),
Common.generateRandomNumber(11),
Common.getRandomEmail(), 666666, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
userId = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)[0][0]
termFinancialId = values["termFinancialId"]
bank = ("中国工商银行", "1", "3127843237358576", userId, balance, "1")
Common.getBankIfNotExistAddBankCard(self.db, self.cursor, userId, bank)
# 检查银行卡余额
Common.checkBankCardBalance(self.db, self.cursor, userId, balance)
## 补齐个人信息
Common.checkUserDetail(self.db, self.cursor,
Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2), user)
params = {}
params["userId"] = userId
params["termFinancialId"] = termFinancialId
params["passWord"] = str(values["passWord"]) +" ; drop table user;"
req = requests.post(self.url, params=params)
req.encoding = "UTF-8"
status = req.status_code
self.assertEqual(targets["status"], status)
if __name__ == '__main__':
unittest.main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化