Coder Social home page Coder Social logo

catarse-api-specs's Introduction

Catarse API specification Circle CI

Requirements

  • Mac OS X or Ubuntu Linux
  • PostgreSQL 9.4+ with default contrib extensions
  • Python 2.7.10+
  • pyresttest
  • click

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 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

catarse-api-specs's People

Contributors

devton avatar diogob avatar lerrua avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.