2019年12月4日

批量执行用例,且结果显示在html中,python控制台也会显示运行过程

摘要: 下载HTMLTestRunner.py放到python安装目录的Lib下; 如下以登录为例,创建不同的.py文件, #runall.py代码如下import unittest,HTMLTestRunnerimport osdef runa(): path=os.getcwd() print(path 阅读全文

posted @ 2019-12-04 22:52 星空6 阅读(831) 评论(0) 推荐(0)

centos7下关闭防火墙

摘要: 查看防火墙:systemctl status firewalld.service 关闭防火墙:systemctl stop firewalld.service 以上方式是暂时的,重启系统则防火墙仍然开启 永久关闭防火墙:systemctl disable firewalld.service 阅读全文

posted @ 2019-12-04 15:02 星空6 阅读(232) 评论(0) 推荐(0)

linux下常用命令

摘要: 查看ip地址:ip addr ;ifconfig 复制文件:cp 源文件 目的文件;cp -r 源文件 目的文件 移动文件 或该文件名:mv 源文件 目的文件 (若是目的文件不存在,会自动新建,相当于该名) 查看当前目录下的文件ls,ll;查看当前所在位置pwd 改文件属主:chown root:r 阅读全文

posted @ 2019-12-04 14:57 星空6 阅读(119) 评论(0) 推荐(0)

VMware workstation安装centos7,无ifconfig命令

摘要: 一、centos7默认未启动ifconfig,vi /etc/sysconfig/network-scripts/ifcfg-ens33,改成ONBOOT=yes; systemctl restart network重启网络;ip addr查看ip地址 二、默认无ifconfig命令,yum ins 阅读全文

posted @ 2019-12-04 10:58 星空6 阅读(962) 评论(0) 推荐(0)

2019年12月3日

python批量执行脚本,使用unittest.TestSuit(); unittest.TextTestRunner().run(); addTest();unittest.defaultTestLoader.discover();

摘要: #alltest.py中内容如下import unittest,osdef all(): #path="D:\\study\\python_api_test\\test1203" #手动添加路径 path=os.getcwd() #获取路径 files=unittest.defaultTestLoa 阅读全文

posted @ 2019-12-03 23:33 星空6 阅读(823) 评论(0) 推荐(0)

2019年12月2日

unittest,requests,assertEqual实战演练

摘要: 请求方式:POST请求url:https://api.apiopen.top/developerLogin请求参数:名称 类型 必须 描述 示例name string 是 账号 peakchaopasswd string 是 密码 123456 import unittest,requestscla 阅读全文

posted @ 2019-12-02 23:15 星空6 阅读(503) 评论(1) 推荐(0)

谷歌浏览器安装JsonView插件

摘要: 可方便阅读json格式文件,参考https://www.jianshu.com/p/6ea9f2245f4d 阅读全文

posted @ 2019-12-02 22:15 星空6 阅读(146) 评论(0) 推荐(0)

unittest断言

摘要: 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 阅读全文

posted @ 2019-12-02 21:47 星空6 阅读(147) 评论(0) 推荐(0)

2019年12月1日

unittest执行顺序,使用unittest.main()按照test开头,由0-9,A-Z,a-z的顺序执行; 可使用TestSuite类的addTest方法改变执行顺序;

摘要: import unittestclass Study(unittest.TestCase): # def setUp(self): # print('start') # def tearDown(self): # print('end') def test_login(self): print('l 阅读全文

posted @ 2019-12-01 22:18 星空6 阅读(761) 评论(0) 推荐(0)

unittest单元测试,基于java的junit测试框架

摘要: import unittestclass study(unittest.TestCase): def testXia(self): self.assertEqual((3*4),20) def testHong(self): self.assertEqual(2,2)if __name__=="__ 阅读全文

posted @ 2019-12-01 17:58 星空6 阅读(1397) 评论(0) 推荐(0)

导航