diff --git a/tests/test_api.py b/tests/test_api.py index 5650f3e..466a30d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -6,6 +6,7 @@ from src.api import get_coordinates, get_uv, ocean_information + def test_get_coordinates(): coordinates = get_coordinates(["loc=santa_cruz"]) lat = coordinates[0] @@ -13,13 +14,14 @@ def test_get_coordinates(): assert isinstance(lat, (int, float)) assert isinstance(long, (int, float)) + def test_get_uv(): uv = get_uv(37, 122, 2) assert isinstance(uv, (int, float)) + def test_ocean_information(): ocean = ocean_information(37, 122, 2) assert isinstance(ocean[0], (int, float)) assert isinstance(ocean[1], (int, float)) assert isinstance(ocean[2], (int, float)) - diff --git a/tests/test_cli.py b/tests/test_cli.py index b5ef8bf..5cffd56 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3,9 +3,11 @@ Make sure pytest is installed: pip install pytest Run pytest: pytest """ -from src import cli + import time +from src import cli + def test_cli_output(): """ diff --git a/tests/test_helper.py b/tests/test_helper.py index fc717b1..db4acf6 100644 --- a/tests/test_helper.py +++ b/tests/test_helper.py @@ -9,6 +9,7 @@ from src.helper import extract_decimal + def test_invalid_input(): """ Test if decimal input prints proper invalid input message @@ -19,9 +20,10 @@ def test_invalid_input(): expected = "Invalid value for decimal. Please provide an integer." assert printed_output == expected + def test_default_input(): """ Test that when no decimal= in args, 1 is the default """ decimal = extract_decimal([]) - assert 1 == decimal \ No newline at end of file + assert 1 == decimal