Questions tagged [tavern]

Tavern is a pytest plugin, command-line tool and Python library for automated testing of APIs, with a simple, concise and flexible YAML-based syntax.

24 questions
0
votes
1 answer

Saving the request sent in a variable in Tavern

I have the below tavern test file: test_name: Create a new book and get the book stages: - name: Create a book request: url: http://localhost:8000/books method: POST json: name: "Tell me your dreams" author:…
Subhayan Bhattacharya
  • 5,407
  • 7
  • 42
  • 60
0
votes
0 answers

Storing pytest config data

This is an extension of this question. My pytest/tavern testsuite has some variables/data that is directly related to generating session keys (using hooks in the conftest.py), and other test configuration. I was wondering if it would be acceptable…
0
votes
2 answers

Saving Variables in Tavern 1.0.0

I am testing my REST endpoints with Tavern. Basically, all I am doing is doing a GET request, trying to save the response, and then use a part of that response for a subsequent UPDATE test. # test_.tavern.yaml file # GET test_name: Get Rules by…
David Pham
  • 187
  • 1
  • 4
  • 14
0
votes
1 answer

What does a "JMES path query" look like when saving a variable in Tavern?

In my Tavern test file, I save a variable like so: [...] save: headers: csrf: x-csrf-token [...] When I run pytest, it logs this warning: tavern/util/dict_util.py:119: FutureWarning: In a future version of Tavern, selecting for values to save…
Mossmyr
  • 909
  • 2
  • 10
  • 26
0
votes
1 answer

Tavern - can't post files using aws pre-signed url

I'm new to Tavern and I'm implementing tests for an AWS API Gateway application. Case Description and Normal Approach In my case, I use pre-signed URLs to directly upload files to S3 bucket. A pre-signed URL is formed by the following…
Rshad Zhran
  • 496
  • 4
  • 17
0
votes
1 answer

Need bring actual date in .yalm file

I'm using "tavern" for testing a Django API rest. I pretty new in this library and I don't know if my question is posible but need the date atribute in second header, bring a current date and not hard-code one. Is it possible? stages: - name:…
Iván
  • 401
  • 2
  • 6
  • 17
0
votes
1 answer

How to set timeout as variable in Tavern test?

I have two yaml files for my tests, common.yaml and test.yaml. There are some variables defined in common.yaml: name: Common test information description: Common data used by test cases variables: url: http://localhost:8080/v2 timeout: 30 In…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
0
votes
3 answers

BadSchemaError: How to validate YAML schema for Python/Tavern

I am Python programmer, so I'd like to use Tavern for API testing. It means writing a program (API test) in YAML. Problem is, when I edit YAML input, it often breaks with error BadSchemaError. Tavern has pykwalify embedded, but error messages are…
0
votes
1 answer

How to check order of returned records in yaml

Below is the response body of my REST API. I am trying to test this API using Tavern. [ [ "ValidOnceAgain", "2019-03-15 00:29:54.579698" ], [ "Comment1", "2019-03-14 21:39:08.016504" ] ] My task is to check that these…
Kunal Badade
  • 25
  • 1
  • 8
1
2