def test_001(self): print('http_requests_post_one') expected = "手机号不能为空" url = 'http://47.107.168.87:8080/futureloan/mvc/api/member/login' res = HttpRequests(url, '{"mobilephone":"","pwd":"123456"}', 'post').httprequests().text self.assertIn(expected, res)
def test_002(self): print('http_requests_get_two') expected = "用户名或密码错误" url = 'http://47.107.168.87:8080/futureloan/mvc/api/member/login' params = {'mobilephone': '18688773467', 'pwd': '12345678'} res = HttpRequests(url, params, 'get').httprequests().text self.assertIn(expected, res)
def test_002(self): print('http_requests_post_two') expected = "登录成功" url = 'http://47.107.168.87:8080/futureloan/mvc/api/member/login' res = HttpRequests( url, json.loads('{"mobilephone":"18688773467","pwd":"123456"}'), 'post').httprequests().text self.assertIn(expected, res)
def test_002(self,expected,url,params): # print('http_requests_post_two') # expected = "密码不能为空" # url = 'http://47.107.168.87:8080/futureloan/mvc/api/member/login' res = HttpRequests(url, params, 'post').httprequests().text self.assertIn(expected, res)
def test_001(self,expected,url,params): res = HttpRequests(url, params, 'post').httprequests().text self.assertIn(expected, res)