cailei0596 / REST_API_Test_Framework_Python

REST API Test Framework example using Python requests and flask for both functional and performance tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A RESTful API testing framework example

Features:

  • Support both functional and performance tests

  • Common get/post function to

  1. Print every request and response in a API output file
  2. Append common headers
  3. Take care of request exception and non-200 response codes and return None, so you only need to care normal json response.
  • Use flask to mock service

  • html report

Install:

pip install -U pytest requests Flask pytest-html

Run:

cd Scripts

Run Functional tests:

pytest

Run Performance tests:

python perf_test_rest_api.py

Medium Post

Check out the medium post for more details.

About

REST API Test Framework example using Python requests and flask for both functional and performance tests.

License:MIT License


Languages

Language:Python 100.0%