This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos: | |
- hooks: | |
- id: trailing-whitespace | |
- id: check-added-large-files | |
- id: check-ast | |
- id: check-docstring-first | |
- id: debug-statements | |
language_version: python3 | |
- id: check-executables-have-shebangs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-pip: | |
@pip install --upgrade pip | |
install: update-pip requirements.txt | |
@pip install -r requirements.txt | |
install-dev: requirements-dev.txt | |
@pip install -r requirements-dev.txt | |
run: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'data': 'Hello from the shield.io json endpoint!' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": "Hello from the shield.io json endpoint!" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"schemaVersion": 1, | |
"label": "name", | |
"message": "your-name", | |
"color": "color-name", | |
"labelColor": "color-name", | |
"style": "style-name" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module sets up the fixtures that will be used in our testing.""" | |
import pytest | |
from API import app | |
@pytest.fixture | |
def client(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module tests the home route.""" | |
def test_home(client): | |
"""Tests that the home route returns ok message on GET request. | |
GIVEN we have the /api/v1 route | |
WHEN we send a GET request | |
THEN we should get a 200 OK response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains initialization code for the API package.""" | |
from dotenv import load_dotenv | |
from flask import Flask | |
load_dotenv() | |
app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module creates the routes for our API.""" | |
from API import app | |
@app.route('/api/v1', methods=['GET']) | |
@app.route('/', methods=['GET']) | |
def api_home() -> dict: | |
"""Handle get requests to /api/v1 route. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FLASK_APP=API/__init__.py | |
FLASK_ENV=development |
OlderNewer