上一页 1 ··· 4 5 6 7 8
摘要: import json class HandleJson: ''' 定义一个json格式数据处理类 ''' @staticmethod def loads_data(data): ''' 将json数据格式的数据转换为字典型的数据类型 :param data: json格式字符串 :return: 阅读全文
posted @ 2019-08-23 15:48 小公瑾 阅读(2626) 评论(0) 推荐(2) 编辑
摘要: --mysql数据库的十种查询方式 -- (1)查询时起别名 -- (2)查询时添加常量列 -- (3)查询时合并列-- 注意:只能合并数值列 -- (4)查询时去除重复 -- 另一种方式 -- (5)条件查询-- 1.逻辑条件(and与 or或)-- 1.1查询id=1且age=18的学生信息 - 阅读全文
posted @ 2019-08-22 19:45 小公瑾 阅读(1754) 评论(0) 推荐(0) 编辑
摘要: 问题现象: 有时系统设置了一种文件,无法编辑其所有权​ 或者root用户下执行 chown users:username {filename} 但是无权限操作 Operation not permitted 解决方法:​ 执行命令sudo chattr -i {filename} 其中{filena 阅读全文
posted @ 2019-08-21 11:13 小公瑾 阅读(7259) 评论(0) 推荐(0) 编辑
摘要: 优化版本的HTMLTestRunner模块,从我的百度网盘获取: 链接:https://pan.baidu.com/s/1f8eLpX5qBrpJsVlXKjquRQ 提取码:qqlu 测试报告展示: 代码展示: import unittest from datetime import dateti 阅读全文
posted @ 2019-08-18 13:43 小公瑾 阅读(511) 评论(0) 推荐(0) 编辑
摘要: 在接口自动化测试框架中,我们的代码除了能在本地运行,也能在不在修改代码的前提下在其他的环境下能够运行,这样才能达到高复用性和低维护成本,我们在接口测试的模块调用中,会定义很多相关路径,而这些路径必须使用相对路径且能够动态获取才能够满足框架的基本要求,因此我们可以单独创建一个constants模块处理 阅读全文
posted @ 2019-08-18 13:40 小公瑾 阅读(1970) 评论(0) 推荐(1) 编辑
摘要: import re import os from scripts.handle_mysql import HandleMysql from scripts.handle_config import HandleConfig from scripts.constants import CONFIGS_ 阅读全文
posted @ 2019-08-18 13:39 小公瑾 阅读(293) 评论(0) 推荐(0) 编辑
摘要: from configparser import ConfigParser class HandleConfig: ''' 定义一个配置文件处理类 ''' def __init__(self, filename): self.filename = filename # 配置文件名 self.conf 阅读全文
posted @ 2019-08-18 13:38 小公瑾 阅读(263) 评论(0) 推荐(0) 编辑
摘要: from openpyxl import load_workbook from scripts.handle_config import conf from scripts.constants import DATAS_FILE_PATH actual_col = conf.get_int("mes 阅读全文
posted @ 2019-08-18 13:37 小公瑾 阅读(253) 评论(0) 推荐(1) 编辑
摘要: import logging from scripts.handle_config import conf from scripts.constants import LOGS_DIR class HandleLogger: ''' 定义一个日志处理类 ''' def __init__(self): 阅读全文
posted @ 2019-08-18 13:34 小公瑾 阅读(273) 评论(0) 推荐(0) 编辑
摘要: import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) class HandleRequests: def __init__(self): self.one_ 阅读全文
posted @ 2019-08-18 13:33 小公瑾 阅读(526) 评论(0) 推荐(0) 编辑
摘要: import pymysql class HandleMysql: ''' 定义一个mysql处理类 ''' def __init__(self, hostname, username, password, database_name, port=3306): ''' 建立数据库连接并创建字典类型游 阅读全文
posted @ 2019-08-18 13:31 小公瑾 阅读(287) 评论(0) 推荐(0) 编辑
摘要: import time import paramiko class HandleParamiko: ''' 定义一个linux处理类 ''' def __init__(self, hostname, password, port=22, username='root'): ''' 构造器 :para 阅读全文
posted @ 2019-08-18 13:26 小公瑾 阅读(566) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8