- 博客(13)
- 收藏
- 关注
原创 导入数据库shell脚本
#! /bin/bash echo "========================================== [数据库导入]" ########################################################## DB_NAME=sdr_usrp # 获取mysql命令 MYSQL=`which mysql` # 登录mysql $MYSQL test -u root -p123456 << EOF # 删除现有的数据库 drop data
2022-02-11 09:01:57
773
原创 Python 快速排序算法
def quick_sort(arr,start=0,end=None): if end is None: end = len(arr)-1 if end<=start: return arr i,j = start,end ref = arr[start] while j>i: if arr[j]>= ref: j = j - 1 else:
2022-01-26 14:16:56
602
原创 Python 字符串中找到所有的整数,列表返回
# -- coding: utf-8 -- def main(st): cur_max_length = 0 max_length = 0 left = 0 lists = [] status = False s = set('0123456789') for i, v in enumerate(st): if v in s: cur_max_length += 1 # if cur_m
2022-01-26 11:37:50
1296
原创 Python实现:在字符串中找出连续最长的数字串
# -- coding: utf-8 -- # Python 2.7 data = { '': [], 'aaaaa': ['a'], 'aabb': ['ab'], 'pwwkew': ['wke'], 'brfgdchi': ['brfgdchi'], 'abcdabcdb': ['abcd', 'bcad', 'cdab', 'dabc'], } def main(s): li = [] left = 0 right = 0
2022-01-20 14:48:00
1726
原创 自动化测试用例,测试边界值范围(asyncio + pytest)
import asyncio import pytest region_id = cfg.CONF.region_id zone_id = cfg.CONF.zone_id class TestParamRunInstances(TestBase): @retry_with_error_code(retry_num=1, always_retry=True, error_codes=['InvalidSecurityGroupId.NotFound']) async def test_
2021-01-28 20:24:54
962
1
原创 pool 资源池
# pool 资源池 @except_and_raise(IndexError, NoResourceError, 'image') async def first_image(self, region_id=None, image_name=None, status=None) -> Image: """ 获取第一个镜像 """ region_id = region_id or self.region_id
2021-01-22 20:13:10
115
原创 接口自动化测试用例(asyncio)
# 自动化测试用例 class TestParamRunInstances(TestBase): @retry_with_error_code(retry_num=1, always_retry=True, error_codes=['InvalidSecurityGroupId.NotFound']) async def test_param_instance_invalid(self): """ 使用合法和非法入参测试 RunInstances: Inval
2021-01-22 20:11:06
1057
2
原创 底层获取指令集用例的测试函数
# 底层获取指令集用例的测试函数 def get_test_funcs(self, items: List[Item]) -> (FuncDict, List): """ 获取用例的测试函数封装 """ region_id = cfg.CONF.region_id region_test_funcs: FuncDict = OrderedDict() sync_test_funcs = [] for item in items:
2021-01-22 20:06:21
70
原创 Python命令行神器之Click从命令行读取参数值
@click.group 装饰器把方法装饰为可以拥有多个子命令的 Group 对象。 @click.group() @click.version_option(version=version, prog_name=‘tests’) def cli(): pass
2020-06-29 11:10:15
506
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人