摘要:#alltest.py中内容如下import unittest,osdef all(): #path="D:\\study\\python_api_test\\test1203" #手动添加路径 path=os.getcwd() #获取路径 files=unittest.defaultTestLoa
阅读全文
摘要:请求方式:POST请求url:https://api.apiopen.top/developerLogin请求参数:名称 类型 必须 描述 示例name string 是 账号 peakchaopasswd string 是 密码 123456 import unittest,requestscla
阅读全文
摘要:import unittestclass xixi(unittest.TestCase): def test_1(self): a=3 b=4 #self.assertEqual(a,b) #a,b是否相等,不相等则报错 #self.assertNotEqual(a,b) #a,b不相等,则成功 d
阅读全文
摘要:import unittestclass Study(unittest.TestCase): # def setUp(self): # print('start') # def tearDown(self): # print('end') def test_login(self): print('l
阅读全文
摘要:import unittestclass study(unittest.TestCase): def testXia(self): self.assertEqual((3*4),20) def testHong(self): self.assertEqual(2,2)if __name__=="__
阅读全文
摘要:#查询中通快递import requestsrr=requests.session()headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chr
阅读全文
摘要:import requests,reheaders={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/5
阅读全文
摘要:import re re.findall(' <input name="address_id" type="hidden" value="(.*?)" />',neww.content.decode("utf-8")) #返回的是一个列表,使用re.match匹配不到内容;re.findall是匹配
阅读全文
摘要:import requestsheader={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.3
阅读全文
摘要:import requestsheader={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.3
阅读全文