Skip to content

jgamer42/leanware_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published