from FastRequest.ReqRespBunch import *
from FastRequest.RestReqFactory import *
from FastRequest.Runner import *
FastRequest
Wrapper around Request lib. For chaining the rest calls along with its reponse
Install
pip install FastRequest
How to use
The dynamic data polutaion is achived by using anonymous functions with formatted string to fetch Env varibles like get_env('key')
.
= RestReqFactory(
req1 ="GET",
method= lambda: f"{get_env('url1')}/get",
url_provider= lambda : {
params_provider"foo1": 'foo1',
"foo2": "foo2",
}
)= RestReqFactory(
req2 ="GET",
method= lambda : f"{get_env('url2')}/api/users/2",
url_provider
)= ReqRespBunch([req1, req2]) reqs
'url1', 'https://postman-echo.com')
set_env('url2', 'https://reqres.in') set_env(
= Runner()
runner runner.run(reqs)
Design
It implows callback sytem both before and after each Rest Request. Which gives the chanse to weive together the response with the next request and any required validation. Please consider the below digram.