Skip to content

Commit

Permalink
test: unit test for get_levels_values
Browse files Browse the repository at this point in the history
  • Loading branch information
fjugipe committed Nov 22, 2024
1 parent f119e88 commit cd4cb01
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions api/test/test_api_utilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest

from utilities import get_levels_values

levels_in_out = [
("1", ["100"]),
("1,2", ["100", "200"]),
("1,2, 3", ["100", "200", "300"]),
("1/3", ["100/300"]),
("../3", ["../300"]),
("1/..", ["100/.."]),
("R3/1.2/0.3", ["120", "150", "180"]),
("1, 3/5, R3/5/0.1,11", ["100", "300/500", "500", "510", "520", "1100"]),
]


@pytest.mark.parametrize("levels_in, levels_out", levels_in_out)
def test_get_levels_values(levels_in, levels_out):
assert get_levels_values(levels_in) == levels_out

1 comment on commit cd4cb01

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Unit Test Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
datastore_pb2.py614821%34–81
datastore_pb2_grpc.py542750%15–16, 19, 65–80, 121–123, 128–130, 135–137, 142–144, 148–173, 219, 246, 273, 300
export_metrics.py100100% 
grpc_getter.py201145%15–19, 23–26, 30–32, 36–38
locustfile.py15150%1–31
main.py43784%45, 50, 60, 70–71, 81–82
metadata_endpoints.py663252%45–54, 58, 85, 100–220, 224
response_classes.py50100% 
utilities.py1803978%21, 39, 46, 68–71, 79–90, 95–102, 122, 126, 128, 156, 162, 180, 238–244, 248–250, 280, 284, 306, 311
custom_geo_json
   edr_feature_collection.py60100% 
formatters
   __init__.py110100% 
   covjson.py60198%91
   geojson.py21290%27, 52
openapi
   custom_dimension_examples.py40100% 
   edr_query_parameter_descriptions.py110100% 
   openapi_examples.py130100% 
routers
   __init__.py00100% 
   edr.py101496%348–349, 438–439
   feature.py471960%99–132, 148–153, 159–181
TOTAL72820572% 

Title Coverage Tests Skipped Failures Errors Time
API Unit Tests Coverage 40 0 💤 0 ❌ 0 🔥 1.875s ⏱️
Ingest Unit Tests Coverage 16 0 💤 0 ❌ 0 🔥 1m 43s ⏱️

Please sign in to comment.