taverntesting / tavern

A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax
https://taverntesting.github.io/
MIT License
1.03k stars 195 forks source link

Allow multi part file uploads #870

Closed michaelboulton closed 1 year ago

michaelboulton commented 1 year ago

Fixes #833

SyntaxColoring commented 1 year ago

Tested and confirmed that this works for my simple use case, which was like this:

test_name: Upload multiple files

stages:
  - name: Upload multiple files
    request:
      url: 'http://localhost/foo'
      method: POST
      files:
        - form_field_name: files
          file_path: '/path/to/file/1'
        - form_field_name: files
          file_path: '/path/to/file/2'
    response:
      status_code: 201

Thank you!