Questions tagged [pyresttest]

A REST testing and API microbenchmarking tool

About

  • A REST testing and API microbenchmarking tool
  • Tests are defined in basic YAML or JSON config files, no code needed
  • Minimal dependencies (pycurl, pyyaml, optionally future), making it easy to deploy on-server for smoketests/healthchecks
  • Supports generate/extract/validate mechanisms to create full test scenarios
  • Returns exit codes on failure, to slot into automated configuration management/orchestration tools (also supplies parseable logs)
  • Logic is written and extensible in Python

Links

11 questions
2
votes
1 answer

Docker CMD not accepting build arg

DockerFile FROM thoom/pyresttest ARG url ENV api_url=$url COPY ./tests usr/src/app WORKDIR usr/src/app ENTRYPOINT [ "pyresttest" ] RUN echo "Oh dang look at that $url" CMD [ "$api_url","api_test.yml" ] api_test.yml -…
2
votes
0 answers

how to create a loop in pyresttest?

I am trying to create a loop in PyRestTest, this is my code: # Login - test: - group: 'Login' - name: 'Test login post' - url: {template: 'api/login/'} - method: 'POST' - body: {template:'{"username":"$username", …
1
vote
0 answers

Test POST request for multipart/form-data in Pyresttest

I need to test API for multipart/form-data using pyresttest. I have tried https://github.com/svanoort/pyresttest/issues/158 for my API but it's not working. I have created formdata.txt: ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Type:…
1
vote
1 answer

Variables are not passing from one test set to another?

Hi, I declared variables in config and iam using in below test case. the variables are not passing. iam not able to figure out the actual issue. config: variable_binds: {'user_id': 'ravitej', 'pass': 'password', 'auth':…
Ravi Teja
  • 45
  • 1
  • 10
1
vote
1 answer

pyresttest run all tests in directory

I have some testcase files of type yaml in a directory. Im using pyresttest to run them and test my app. I want to run all tests in the directory. I can write a script to do it but is there anyway run all testcases with pyresttest ?
Amin
  • 755
  • 6
  • 21
0
votes
0 answers

How can i use a Validator to check with the Response in a SOAP XML Request sent through PyRestTest

My YAML Files looks like the following : config: testset: "add user" test: name: "incorrect pw with status code" url: "/user/add" method: "POST" body: "I HAVE ATTACHED THE WHOLE XML BODY REQUEST" headers: {'Content-Type:…
RuqiJam
  • 3
  • 2
0
votes
1 answer

Anybody know how to use pyresttest's 'fixed_sequence' generator?

I'm trying to use pyresttest's benchmarking framework to generate a sequence of entries in my flask_sqlalchemy-based database. I would like to read input values from a pre-defined list as advertised by this framework's benchmarking generator type…
kip2
  • 6,473
  • 4
  • 55
  • 72
0
votes
1 answer

unable to add own extension with generator in pyresttest

I am investigating usage of pyresttest for testing our api calls also new to python and stuck a bit on: have a file with generator: import pyresttest.validators as validators from pyresttest.binding import Context import sys import datetime …
0
votes
2 answers

PyRestTest: Print out passed test cases as well

I'm using PyRestTest on linux to test some REST APIs. On the terminal, I only see test cases that failed. How can I get resttest.py to print out the passes test cases as well? I tried looking at the src for resttest.py, but couldn't find a switch.…
earlence
  • 323
  • 1
  • 4
  • 11
0
votes
1 answer

Can we define generators inside a test body in pyrestest framework

I am trying to define generators inside a test body instead of config section. Those who are familiar with pyresttest framework, generators are a way to dynamically define variables for your test Documentation --- - config: - testset: "Benchmark…
python
  • 4,403
  • 13
  • 56
  • 103
0
votes
2 answers

pyresttest - Unable to read body from a DELETE request

Consider the following template which is used to delete an entity from DB. - test: - group: "Basic Test" - name: "Delete 10.24.39.202" - url: "/v1/switch" - method: 'DELETE' - expected_status: [200] - body: '{"ip_address":…
Pradeep
  • 1,198
  • 3
  • 12
  • 22