-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
name: "Lint and Formatting" | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint | ||
run: | | ||
pip install pylint | ||
pylint --fail-under=9.5 src/ | ||
- name: Format | ||
run: | | ||
pip install black | ||
black src/ --check | ||
IMPLEMENT THIS FILE |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
name: "Unit Tests" | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run tests | ||
run: | | ||
python3 -m unittest test/test.py | ||
IMPLEMENT THIS FILE |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "Lint and Formatting" | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint | ||
run: | | ||
pip install pylint | ||
pylint --fail-under=9.5 src/ | ||
- name: Format | ||
run: | | ||
pip install black | ||
black src/ --check |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
from flask import json | ||
from src.app import app | ||
|
||
class UnitTest(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.app = app.test_client() | ||
self.app.testing = True | ||
|
||
def test_hello_endpoint(self): | ||
response = self.app.get("/") # This is to help you get started | ||
# TODO : Write a test for the '/' endpoint | ||
# TODO : Assert the status code is 200 | ||
# TODO : Assert the response is "Welcome to the Blueprint Software Dev Crash Course!" | ||
|
||
def test_get_tasks(self): | ||
# TODO : Write a test for the '/tasks' endpoint | ||
# TODO : Assert the status code is 200 | ||
# TODO : Assert the response is a list | ||
# TODO : Assert the list is not empty | ||
# TODO : Assert the list contains a dictionary with keys "id", "title", and "completed" | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Unit Tests" | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run tests | ||
run: | | ||
python3 -m unittest test/test.py |