From 0b48956151550e4cd0097b205d030b53f2913c77 Mon Sep 17 00:00:00 2001 From: Christos Galanopoulos Date: Sat, 8 Feb 2025 13:36:46 +0200 Subject: [PATCH 1/3] add fourth parama func --- src/app/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/main.py b/src/app/main.py index 540d9e7..47e56b0 100644 --- a/src/app/main.py +++ b/src/app/main.py @@ -31,13 +31,13 @@ def get_hello_3(string_1: str, string_2: str, string_3: str): return f"Hello {string_1}, {string_2}, {string_3}" -# @app.get( -# "/{string_1}/{string_2}/{string_3}/{string_4}", -# response_model=str, -# status_code=status.HTTP_200_OK, -# ) -# def get_hello_4(string_1: str, string_2: str, string_3: str, string_4: str): -# return f"Hello {string_1}, {string_2}, {string_3}, {string_4}" +@app.get( + "/{string_1}/{string_2}/{string_3}/{string_4}", + response_model=str, + status_code=status.HTTP_200_OK, +) +def get_hello_4(string_1: str, string_2: str, string_3: str, string_4: str): + return f"Hello {string_1}, {string_2}, {string_3},{string_4}" if __name__ == "__main__": From 359304e80a41498a34059bb0df067371182bf543 Mon Sep 17 00:00:00 2001 From: Christos Galanopoulos Date: Sat, 8 Feb 2025 13:38:08 +0200 Subject: [PATCH 2/3] add fourth param test --- src/tests/test_main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/test_main.py b/src/tests/test_main.py index fec9bed..e278654 100644 --- a/src/tests/test_main.py +++ b/src/tests/test_main.py @@ -29,10 +29,10 @@ def test_get_hello_3(): assert response.json() == "Hello devops, engineers, again" -# def test_get_hello_4(): -# response = client.get(url="/devops/engineers/once/more") -# assert response.status_code == 200 -# assert response.json() == "Hello devops, engineers, once, more" +def test_get_hello_4(): + response = client.get(url="/devops/engineers/once/more") + assert response.status_code == 200 + assert response.json() == "Hello devops, engineers, once, more" def test_not_found(): From a2e82ab02556c39455f87fd2ba371c6e799da7eb Mon Sep 17 00:00:00 2001 From: Christos Galanopoulos Date: Sat, 8 Feb 2025 13:43:43 +0200 Subject: [PATCH 3/3] fix space typo --- src/app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/main.py b/src/app/main.py index 47e56b0..51cb329 100644 --- a/src/app/main.py +++ b/src/app/main.py @@ -37,7 +37,7 @@ def get_hello_3(string_1: str, string_2: str, string_3: str): status_code=status.HTTP_200_OK, ) def get_hello_4(string_1: str, string_2: str, string_3: str, string_4: str): - return f"Hello {string_1}, {string_2}, {string_3},{string_4}" + return f"Hello {string_1}, {string_2}, {string_3}, {string_4}" if __name__ == "__main__":