Coder Social home page Coder Social logo

add-automated-tests-off-platform-project's Introduction

BankAccount

This is an educational public repository to illustrate the power of automated testing through Github Actions.

Run locally

  1. Set up Python virtual environment.
python -m venv venv
  1. Install required dependencies.
pip install -r requirements.txt
  1. Run unit tests.
python -m pytest
  1. Run the app.
python app.py

Code Description

  1. app.py: A flask application that exposes the following API endpoints:
  • index at / : Retun a JSON data structure indicating the current balance.
  • deposit at /deposit : Take the deposit amount as a URL parameter and return the new balance after adding the amount.
  • withdraw at /withdraw : Take the withdrawal amount as a URL parameter and return the new balance after subtracting the amount. App relies on a global in-memory variable (balance) to store the balance of the account.
  1. requirements.txt: A text file including all the Python libraries and packages needed to run the app.

  2. .gitignore: Refer to the gitignore article for more details. In short, this file makes it possible that local configuration or binary files are not pushed to the repository.

  3. tests: It's a directory that includes several unit tests for the APIs. The tests utilize the PyTest library.

add-automated-tests-off-platform-project's People

Contributors

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