Tapi is a framework for testing APIs
- Test you API without writing any code (only edit a json file)
- Test you APIs in a much more 'natural' way by specifying urls/verbs and what the output should be
- Verify anything from response status codes, headers, body content etc
- Also allows verification by issuing another API call to a different endpoint to ensure a prior API call worked
- Execute arbitrary python scripts to populate request paramaters e.g. custom headers
- Execute arbitrary python scripts to verify response from endpoint is valid
- Tests your APIs using your own APIs
Documentation is available at http://tapi.readthedocs.org/en/latest/#
pip install tapi
In order to start using Tapi you have to write a tapi.json file. The simplest tapi.json file looks like:
{
"tests": [
{
"main": {
"request": {
"url": "http://api.example.com/users"
}
}
}
]
}
The above means the following:
- There is one test in this file
- The framework will make a GET (the default) request to the endpoint api.example.com/users
- The framework will verify that the return status code is 200 (default)
You can run this test by doing: python tapi.py
Thus, without writing a single line of code, you have successfully verfied that this endpoint works.
- Improve / Add more unit tests
- Ability to split tapi.json into multiple files