From 59282125c40ab37f887a5a67112c066b6a6c88b5 Mon Sep 17 00:00:00 2001 From: K-dash Date: Tue, 28 May 2024 11:50:56 +0900 Subject: [PATCH] Remove query_to_args_list function and test code removal This commit removes the query_to_args_list function and its associated test code as they are no longer needed with the Flask move. --- src/backend/helper.py | 8 +------- src/tests/test_code.py | 18 +----------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/backend/helper.py b/src/backend/helper.py index d18bb1b..909c10a 100644 --- a/src/backend/helper.py +++ b/src/backend/helper.py @@ -33,12 +33,6 @@ def arguments_dictionary(lat, long, city, args): } return arguments -def query_to_args_list(query): - """ - Convert query string to a list of arguments. - """ - args = [query] if query else [] - return args def seperate_args(args): """ @@ -220,4 +214,4 @@ def forecast_to_json(data, decimal): } forecasts.append(forecast) - return forecasts \ No newline at end of file + return forecasts diff --git a/src/tests/test_code.py b/src/tests/test_code.py index 87982c5..6477ac4 100644 --- a/src/tests/test_code.py +++ b/src/tests/test_code.py @@ -12,26 +12,10 @@ import io import time from main import main -from helper import extract_decimal, query_to_args_list +from helper import extract_decimal from api import get_coordinates, get_uv, ocean_information -def test_query_to_args_list_with_non_empty_params(): - """ - Test if query_to_args_list function correctly converts non-empty query parameters to a list. - """ - args = query_to_args_list("location=new_york,hide_height,show_large_wave") - assert args == ["location=new_york,hide_height,show_large_wave"] - - -def test_query_to_args_list_with_empty_params(): - """ - Test if query_to_args_list function correctly handles empty query parameters and returns an empty list. - """ - args = query_to_args_list("") - assert args == [] - - def test_invalid_input(): """ Test if decimal input prints proper invalid input message