Skip to content

Commit

Permalink
chore: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ongsici committed Oct 21, 2024
1 parent a2fae96 commit 3a6806f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install pytest
run: pip install pytest
- name: Run pytest
run: pytest test/test_app.py
run: pytest src/test_app.py

deploy-to-impaas:
needs: python-formatting
Expand Down
10 changes: 5 additions & 5 deletions src/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from flask import Flask, render_template, request
app = Flask(__name__)


def process_query(input):
if input == "dinosaurs":
return "Dinosaurs ruled the Earth 200 million years ago"
else:
return "Unknown"


@app.route("/")
def hello_world():
return render_template("index.html")
Expand All @@ -31,11 +33,9 @@ def submit():
gender=input_gender,
happy=input_happiness)


@app.route("/query", methods=["GET"])
def query():
q = request.args.get("q")
q = request.args.get("q")
return process_query(q)


# if __name__ == '__main__':
# app.run(host= "0.0.0.0",port=8000)

10 changes: 10 additions & 0 deletions src/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from app import process_query


def test_knows_about_dinosaurs():
assert process_query("dinosaurs") == "Dinosaurs ruled the Earth 200 million years ago"


def test_does_not_know_about_asteroids():
assert process_query("asteroids") == "Unknown"

11 changes: 0 additions & 11 deletions test/test_app.py

This file was deleted.

0 comments on commit 3a6806f

Please sign in to comment.