随笔分类 - robot源码解读
摘要:Robot Framework documentation http://robotframework.org/robotframework/ 总体入口解读 https://robot-framework.readthedocs.io/en/2.9.1/_modules/robot/running.
阅读全文
摘要:常规装饰器 # 1. 不带参数 def wrapper(func): # 装饰器函数,func为被装饰函数 def inner(*args, **kwargs): """被装饰函数前需要添加的内容""" ret = func(*args, **kwargs) # 被装饰函数 """被装饰函数后需要添
阅读全文
摘要:aliasing ''' ################## ''' # # class Animal: # def __init__(self, favourite_food): # self.favourite_food = favourite_food # # # class Zoo: #
阅读全文
摘要:collections.abc 入门 # 定义个二叉树 ,希望可以 # 输出列表,是二叉树的前序遍历 # 可以进行索引取值,可以获取长度 https://zhuanlan.zhihu.com/p/142663602 ### 普通方法 class BinaryNode(object): def __i
阅读全文
摘要:robot中比较难理解的【元类和描述符类】 【重点1】with_metaclass,init,new 【重点2】get,set with_metaclass见如下文章: https://stackoverflow.com/questions/18513821/python-metaclass-und
阅读全文
摘要:import sys from collections import MutableMapping from .platform import PY3, IRONPYTHON from .robottypes import is_dict_like, is_unicode def normalize
阅读全文
摘要:robot中的timestamp的概念 20210406-104142.897 字符串类型 源码 import time import sys IRONPYTHON = sys.platform == 'cli' def is_number(item): return isinstance(item
阅读全文
摘要:testsuite相关代码中,描述符类装饰器比较难以理解,简化源码方便理解如下 '''robot 源码解读3【testsuite相关】 目的: 1. 查看类的继承关系 2. setter类的理解 ''' # 描述符类, 描述符是作为类的属性而不是实例属性存在的 # 将一个类中的方法装饰成类中的属性
阅读全文
摘要:先看看run case的流程
阅读全文
摘要:先看看多少代码量 import os file_types = ['py', 'html', 'css', 'js', ] def count_code_nums(file): """获取单个文件的行数 """ with open(file, mode='rb') as f: return len(
阅读全文
浙公网安备 33010602011771号