GithubHelp home page GithubHelp logo

geodistance-calculation's Introduction

Distance calculation from the Moscow Ring Road to the specified address

The following features are included in the application:

  • Usage of endpoint blueprints
  • Automated endpoint tests via pytest

Setup

To set up the application, you need Python 3.8. After cloning the repository change to the project directory and install the dependencies via:

sudo apt update
sudo apt install uwsgi-plugin-python3
python3 -m pip install -r requirements.txt

Development

To start the app in development mode, execute

./run_app_dev.sh
or
sh ./run_app_dev.sh

The application will then be available at localhost:5000. You can test the functionality manually using curl, e.g. via

curl localhost:5000/api/v1/getGeoDistance/test

The commands should output

{
  "msg": "I'm the test endpoint from getGeoDistance."
}

For automated testing run the following command:

pytest

The commands should output

test/test_endpoints.py ....
============= 8 passed in 2.58s ==============

Automated test scenarios can be found inside test/test_endpoints.py and it covers the following cases:

1) Normal address is passed and gets correct output
2) No address is passed i.e. empty string
3) Wrong address is sent
4) Address passed is inside MKAD region
5) Wrong input structure cases

For testing on Custom input run the following python script which reads from stdin and saves the output to test.log file.

python3 app.py

To view the API documentation through the Swagger user interface, navivate your browser to localhost:5000/api/docs.

geodistance-calculation's People

Contributors

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