https://github.com/catarse/catarse-api-specs
Catarse API specification
https://github.com/catarse/catarse-api-specs
Last synced: 4 months ago
JSON representation
Catarse API specification
- Host: GitHub
- URL: https://github.com/catarse/catarse-api-specs
- Owner: catarse
- License: mit
- Created: 2015-09-29T23:22:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-05T16:37:19.000Z (about 10 years ago)
- Last Synced: 2025-01-05T20:40:28.417Z (over 1 year ago)
- Language: PLpgSQL
- Size: 25.6 MB
- Stars: 3
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Catarse API specification [](https://circleci.com/gh/catarse/catarse-api-specs)
## Requirements
* Mac OS X or Ubuntu Linux
* PostgreSQL 9.4+ with default contrib extensions
* Python 2.7.10+
* [pyresttest](https://github.com/svanoort/pyresttest)
* [click](http://click.pocoo.org/)
The scripts assume that you have a PostgreSQL running in your local environment
and that you have a database superuser with the same name as the user running the script.
You also need to be able to connect with any arbitrary PostgreSQL user without a password.
If you need to use a password to connect try setting up a [pgpass](http://www.postgresql.org/docs/current/static/libpq-pgpass.html) file.
## Installation
```
pip install -r requirements.txt
```
## Running tests
If everything is installed and configured properly you should be able to run the entire suite
using the command:
```
./api_spec.py run_tests
```
You can also pass one parameter with a different database name to use for testing.
The default name is **catarse_api_test**.
## Updating the database schema
There is a script recreate_schema.sh in the database directory
that will read a given database and store its schema in the file database/schema.sql
After modifying the development database you should run this script
and run the tests to check if everything is still working.
```
./api_spec.py recreate_schema --name=database_name
```
## Adding tests
The tests are organized in files by endpoint, so you should
never test more than one endpoint per yml file.
Add the test file named after the endpoint you are testing, if you are
testing the endpoint **foo**, the test file will be **test/foo.yml**.
To bootstrap a basic get test against the foo endpoint use the command:
```
./api_spec.py generate_test --name=foo
```