GithubHelp home page GithubHelp logo

leanware_test's Introduction

Leanware technical test

python-flask python-pytest aws

Pre-requisites

  • Had installed and runing python3
  • Install and configure AWS CLI
  • Had IAM user For this part check this documentation

Test coverage

Module statements missing excluded coverage
src/helpers/auth.py 20 5 0 75%
src/helpers/date.py 16 1 0 94%
src/investments.py 40 8 0 80%
src/managers/__init__.py 2 0 0 100%
src/managers/investments.py 30 7 0 77%
src/managers/traders.py 21 2 0 90%
src/traders.py 31 7 0 77%
test/controllers/test_investments.py 39 0 0 100%
test/controllers/test_traders.py 31 1 0 97%
test/helpers/test_auth.py 10 0 0 100%
test/helpers/test_date.py 14 1 0 93%
test/managers/test_investment_manager.py 28 0 0 100%
test/managers/test_traders_manager.py 31 2 0 94%
Total 313 34 0 89%

How to use

  1. Login to the API
  2. Try any route

routes

Route Method Use Payload
/login POST This route is used to Login into the API { "username":"your username", "password":"your password" }
/logout GET This route is used to to Logout from the API NA
/investments/symbols GET This route is used to get all available in the API NA
/investments/stocks/<investment_name>/<start_date>/<end_date> GET This route is used to get prices from a stock in given timeframe The investment name param is the name of the stock to check The end date is optional, the dates must be dd-mm-yyyy NA
/insvestments/sotcks/export GET This route is used to a .csv file with the all stocks prices registre in the API NA
/traders/symbols GET This route is used to check which follows the user is following NA
/traders/symbols/update PUT,POST This route is used to update which symbols follows the user { "Symbols" :["list with symbols to follow"] }

Installation

This tutorial is only fonr unix based systems

  1. Create a virtual enviroment
python3 -m venv env
  1. Start the virtualenv
source env/bin/activate
  1. install the dependencies
pip install -r requeriments.txt
  1. Create a reports folder
mkdir reports
  1. Create a .env file , and put the content from .env.example
  2. Fill the .env file
  3. Run the main.py
python main.py

Steps forward

- Add integrations test in the endpoints

leanware_test's People

Contributors

jgamer42 avatar

Stargazers

 avatar

Watchers

 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.