HttpRunner 求教测试上传图片一直报错" multipart_encoder is not found"

alex · 2019年05月24日 · 947 次阅读

RT
借鉴了@debugtalk大大的解决方案 :
https://github.com/HttpRunner/HttpRunner/issues/169
不知道哪里写的不对,纠结好久了,求指点,谢谢
代码和报错如下
test_case

- test:
    name: test_cloudinary_images_post
    variable_binds:
      - field_name: "file"
      - file_path: ${ENV(image_path)}
      - file_type: "image/jpeg"
      - - multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)}
    base_url: ${ENV(base_url_sg_stag)}
    request:
      url: /api/cloudinary_images
      method: POST
      headers:
        Content-Type: ${multipart_content_type($multipart_encoder)}
      data: $multipart_encoder
    validate:
      - eq: ["status_code", 200]
    setup_hooks:
      - ${setup_hook_basicauth($request)}

error

httprunner 和 python 版本

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册