forked from DxvLwRYF/apiAutoTest
增加示例,调用返回值为字典类型的方法
This commit is contained in:
parent
b980ab295f
commit
e0a245de6d
|
@ -117,7 +117,8 @@ https://www.bilibili.com/video/BV1EE411B7SU?p=10
|
|||
2021/05/04 用例增加Header栏,可使用自定义方法,以及提取参数如下,所以取消了 `token操作栏`
|
||||
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504121842.png)
|
||||
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504122609.png)
|
||||
|
||||
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504234703.png)
|
||||
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504234820.png)
|
||||
|
||||
## 博客园首发
|
||||
https://www.cnblogs.com/zy7y/p/13426816.html
|
||||
|
|
Binary file not shown.
|
@ -12,6 +12,7 @@
|
|||
关于exec执行python代码可查阅资料:https://python3-cookbook.readthedocs.io/zh_CN/latest/c09/p23_executing_code_with_local_side_effects.html
|
||||
|
||||
"""
|
||||
import json
|
||||
import time
|
||||
|
||||
|
||||
|
@ -36,6 +37,12 @@ def sum_data(a, b):
|
|||
return a + b
|
||||
|
||||
|
||||
def set_token(token: str):
|
||||
"""设置token,直接返回字典"""
|
||||
return {"Authorization": token}
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 实例, 调用无参数方法 get_current_highest
|
||||
result = exec_func("get_current_highest()")
|
||||
|
|
Loading…
Reference in New Issue