python3+requests接口自动化-登陆模块封装

接口自动化登陆接口封装

 1 import requests
 2 from config import cof
 3 
 4 
 5 class test_user_login():
 6 
 7     def test_Login(self):
 8         s = requests.Session()
 9         route = "/api/Account/Login"
10         url = "".join([cof.route(),route])
11         data = {"UserName":"test012","Password":123456}
12         r = s.post(url,data=data)
13 
14         return r

 

posted @ 2018-10-23 13:22  jaysonzxk  阅读(800)  评论(0编辑  收藏  举报