Skip to content

Commit

Permalink
hard mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Caposto committed Feb 7, 2025
1 parent abfcccd commit 72ae497
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 43 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/lint.yaml
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
20 changes: 1 addition & 19 deletions .github/workflows/test.yaml
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
24 changes: 24 additions & 0 deletions solutions/lint.yaml
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
25 changes: 25 additions & 0 deletions solutions/test.py
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()
19 changes: 19 additions & 0 deletions solutions/test.yaml
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

0 comments on commit 72ae497

Please sign in to comment.