a,b,x=2,4,4
if a>0 and b>0:
x=x/a
if a>1 and x>1:
x=x+1
print(x)
8、 login.py
import requests
def login(username="zhangsan"):
url ="http://127.0.0.1/login"
data = {"username":username,"password":"opms123456"}
head = {"Content-Type:application/x-www-form-urlencoded"}
res = requests.post(url=url,data=data)
print(res.text)
return res.json()
当username返回为空时code返回为0 ,下列测试用例代码格式是否正确【判断题】
test_login.py
from com.api.login import login
class Test_login():
def test_login_1(self):
res = login("")
assert res["code"]==0
x=1
def change(a):
x +=1
print(x)
change(x)
11题 | 被引用0次