GithubHelp home page GithubHelp logo

cybergis-compute-api-tests's Introduction

CyberGIS-Compute API Tests

Authors: CyberGIS-Compute Development Team. Alexander Michels, Taylor Ziegler, Mit Kotak.

This repository is designed to house a variety of tests for check that a CyberGIS-Compute Core API is functioning correctly. We use it as part of our development process to ensure that all routes are functional and returning reasonable results.

Quickstart:

Configure key information in secrets.json (API url, username, token, etc.) and then from the root of the repo run:

> pytest src/test/*

Overview:

The layout is relatively simple. All of the code is contained in src/ and all of the tests are in src/test. There are a few key files for our testing framework:

  • src/config.py - this offers configuration and a few helper functions for all tests. The Secrets class loads the configuration from secrets.json for use by tests. The helper functions it defines add the hashed token and appropriate header to the get/put/post call for simplicity. It is also helpful for manually inspecting API calls.
  • src/helpers.py - Helpers to provide information required by other tests. For example, job Ids for jobid routes. These were originally pytest fixtures, but it was too complex to use fixtures from another file with parameterized functions. I tried a few things and they all failed.

The tests are in src/test and grouped logically.

  • public_routes.py tests public routes (i.e. ones that do not request authentication) like /git and /container.
  • user.py tests /user and other user-centric routes.
  • job.py tests /job and job-centric routes.
  • folder.py tests /folder and folder-centric routes.

Notes:

  • pytest was being weird when I set body={} as a default argument in the config functions because it was persisting the auth.

cybergis-compute-api-tests's People

Contributors

alexandermichels avatar taylorziegler avatar jtsiv1 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.