Skip to content

Commit

Permalink
test update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansurf committed May 26, 2024
1 parent e5efa82 commit 5b44603
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# Load environment variables from .env file
load_dotenv(override=True)
website = bool(os.getenv("WEBSITE"))
json_show = bool(os.getenv("JSON"))
print("JSON: ", json_show)

if website == True:
subprocess.Popen(["python", "-m", "http.server", "9000"], cwd="../frontend")
Expand All @@ -41,6 +39,7 @@
"show_period": 1,
"show_city": 1,
"show_date": 1,
"json_output" : 0,
"unit": "imperial",
"decimal": helper.extract_decimal(args),
"forecast_days": helper.get_forecast_days(args),
Expand All @@ -66,6 +65,10 @@
ocean["show_date"] = 0
if "metric" in args or "m" in args:
ocean["unit"] = "metric"
if "json" in args or "j" in args:
ocean["json_output"] = 1




def gather_data(lat=lat, long=long):
Expand Down Expand Up @@ -95,7 +98,7 @@ def main(lat=lat, long=long):
uv_index = data[1]
data_dict = data[2]

if not json_show:
if ocean["json_output"] == 0:
print("\n")
if coordinates == "No data":
print("No location found")
Expand Down
3 changes: 2 additions & 1 deletion src/tests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import sys
import json

sys.path.append("../backend")

Expand Down Expand Up @@ -51,7 +52,7 @@ def test_ocean_information():
assert isinstance(ocean[2], (int, float))


def test_main():
def test_main_output():
"""
Main() returns a dictionary of: location, height, period, etc.
This functions checks if the dictionary is returned and is populated
Expand Down

0 comments on commit 5b44603

Please sign in to comment.