From 7a6635a6d5636e4e48aac3351dbe307e22f78b2f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 21 Aug 2026 09:36:29 +0000 Subject: [PATCH 1/2] Initial plan From c3166dfb479cc7dd6001ab80890ac583c02c4862 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 21 Aug 2026 09:38:17 +0000 Subject: [PATCH 2/2] Fix build job lint failures and add regression tests Co-authored-by: hakanyorukk <125490544+hakanyorukk@users.noreply.github.com> --- a2/exercise_1.py | 2 +- a2/exercise_2.py | 2 +- basic_math_recursion/task3/exercise_4.py | 2 +- h1/exercise_1.py | 2 +- tests/test_build_fixes.py | 21 +++++++++++++++++++++ 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 tests/test_build_fixes.py diff --git a/a2/exercise_1.py b/a2/exercise_1.py index b903957..eff7401 100644 --- a/a2/exercise_1.py +++ b/a2/exercise_1.py @@ -30,7 +30,7 @@ def status_code_breakdown(records): #counts = Counter(r["status_code"] for r in records if r["status_code"]) counts = {} for r in records: - status = f"{r["status_code"][0]}xx" + status = f"{r['status_code'][0]}xx" counts[status] = counts.get(status, 0) + 1 return counts diff --git a/a2/exercise_2.py b/a2/exercise_2.py index 87a2fbb..0045553 100644 --- a/a2/exercise_2.py +++ b/a2/exercise_2.py @@ -31,7 +31,7 @@ def suspicious_ips(records, treshold=3): def status_code_breakdown(records): counts = {} for request in records: - status = f"{request["status"][0]}xx" + status = f"{request['status'][0]}xx" counts[status] = counts.get(status, 0) + 1 return counts diff --git a/basic_math_recursion/task3/exercise_4.py b/basic_math_recursion/task3/exercise_4.py index 7b805fe..d76c89b 100644 --- a/basic_math_recursion/task3/exercise_4.py +++ b/basic_math_recursion/task3/exercise_4.py @@ -1,6 +1,6 @@ def main(): num = int(input("Enter num> ")) - print(fibonacci(num)) + print(fibonaacci(num)) def fibonaacci(num): diff --git a/h1/exercise_1.py b/h1/exercise_1.py index 350a047..c173149 100644 --- a/h1/exercise_1.py +++ b/h1/exercise_1.py @@ -13,7 +13,7 @@ def summarize_checks(checks, results=[]): status = parts[1] time = parts[2] - if status is "OK": + if status == "OK": healthy.append(server) else: unhealthy.append(server) diff --git a/tests/test_build_fixes.py b/tests/test_build_fixes.py new file mode 100644 index 0000000..c86db15 --- /dev/null +++ b/tests/test_build_fixes.py @@ -0,0 +1,21 @@ +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) + +from a2 import exercise_1, exercise_2 +from basic_math_recursion.task3 import exercise_4 + + +def test_status_code_breakdown_exercise_1(): + records = [{"status_code": "200"}, {"status_code": "404"}, {"status_code": "500"}] + assert exercise_1.status_code_breakdown(records) == {"2xx": 1, "4xx": 1, "5xx": 1} + + +def test_status_code_breakdown_exercise_2(): + records = [{"status": "200"}, {"status": "403"}, {"status": "200"}] + assert exercise_2.status_code_breakdown(records) == {"2xx": 2, "4xx": 1} + + +def test_fibonaacci_function_available_and_works(): + assert exercise_4.fibonaacci(5) == 5