Skip to content

Commit

Permalink
Remove query_to_args_list function and test code removal
Browse files Browse the repository at this point in the history
This commit removes the query_to_args_list function and its associated test code as they are no longer needed with the Flask move.
  • Loading branch information
K-dash committed May 28, 2024
1 parent 222d3ab commit 5928212
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
8 changes: 1 addition & 7 deletions src/backend/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -220,4 +214,4 @@ def forecast_to_json(data, decimal):
}
forecasts.append(forecast)

return forecasts
return forecasts
18 changes: 1 addition & 17 deletions src/tests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5928212

Please sign in to comment.