Wrapper around requests lib for simple API smoketesting
So you’re developing an API client in the attic.
You need a framework for smoketesting api calls.
The API developer has defined their tests in json format. You can then run these tests to verify that you’re getting the expected behavior and escape the attic.
Anne Frank would have dug it.
api-attic 10.0.0.1 api_attic_example.json –force
What it does
It wraps the “requests” python library inserting headers, authentication etc and making your requests to a host, provided as a command line argument.
It checks the response from the server for expected status codes and body/header/json dpath contents and passes or fails the test based on definition.
Can be used to specify and pass/fail on performance of api response.
Copy/paste curl equivalent of the request is included in the output for convenience.
See the api_attic_example.json file as an example of a subset of the the tests available.
Easily introduced into a CI/CD deploy pipeline.
Without –force, any API requests that are not GET’s will be skipped as a safety mechanism to ensure we’re not overwriting or creating data unconciously.
pip install api-attic