提交 fcaee849 编写于 作者: 泰斯特Test's avatar 泰斯特Test

[feat](tester.py & common.py)支持非json响应时的字符串截取设置全局变量

上级 94f48882
......@@ -198,9 +198,7 @@ def dict_get(dic, locators, default=None):
'''
if not isinstance(dic, dict):
if not isinstance(locators, list):
return default
elif isinstance(dic, str) and len(locators) == 1 and is_slice_expression(locators[0]):
if isinstance(dic, str) and len(locators) == 1 and is_slice_expression(locators[0]):
slice_indexes = locators[0].split(':')
start_index = int(slice_indexes[0]) if slice_indexes[0] else None
end_index = int(slice_indexes[-1]) if slice_indexes[-1] else None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册