Git Product home page Git Product logo

devops-course-bank-api's Introduction

Bank API

This is a standalone exercise to practice writing tests and engaging in Test Driven Development (TDD). Clone this repository and then open the resulting DevOps-Course-Bank-API folder in VSCode. Open it as the project folder - don't open a parent folder and then browse down to the repository folder, otherwise subsequent instructions here will not work.

Read through this file to get the project running and then follow the instructions in during_the_workshop.md for the exercise instructions.

Setup

This project requires Python 3.7 and uses Poetry for Python to handle dependencies. Follow the instructions here to set up Poetry.

Run the following command (run from the project root) to install project dependencies:

poetry install

If you opened the repository folder in VS Code (and not a parent folder), then you should get a prompt to use the newly added virtual environment. Agree to it.

If you do not see a prompt, press Cmd/Ctrl + Shift + P and run Python: Select Interpreter. Select the Python executable in the new .venv directory, which is ./.venv/Scripts/python.exe on Windows or ./.venv/bin/python on a Mac.

To launch the API, run the following:

cd bank_api
poetry run flask run

The API should be live with swagger docs visible at http://localhost:5000/.

Tests

You can run both unit and integration tests suites using pytest. Run this from the root directory:

poetry run pytest

Or you can run them from VSCode:

Click the conical flask icon on the activity bar on the left edge of VSCode. Click the refresh icon at the top of the panel to rediscover tests. Click the play icon at the top to run all tests. Click the play icon next to a file or test name to run that file or test individually.

  • Intellisense annotations for running/debugging each test should also appear above the test functions in the code.
  • If test discovery fails, check that "poetry install" ran successfully and that the Python interpreter is selected correctly. See the "setup" section above for details.

You can now go back to the workshop instructions.

devops-course-bank-api's People

Contributors

hugh-emerson avatar jonesey13 avatar robo-softwire avatar benramchandani 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.