Skip to content

Commit

Permalink
update test case to work with list in csv cell for gunw product absol…
Browse files Browse the repository at this point in the history
…ute orbit list
  • Loading branch information
kim committed Apr 9, 2024
1 parent 8eb22d2 commit 15653f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions yml_tests/test_known_bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ tests:
expected code: 200

#DS-1945 open bug for this
# this is still an issue (FARADAY_ROTATION is labeled as a string type which makes searching via float ranges impossible)
# https://cmr.earthdata.nasa.gov/search/collections.umm_json?attribute[]=FARADAY_ROTATION
- maxFaradayRotation:
maxFaradayRotation: 3
maxResults: 10
Expand Down
9 changes: 8 additions & 1 deletion yml_tests/test_url_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ast
import requests, urllib # For talking w/ API
import json, csv # File stuff
import re # Opening/Reading the file stuff
Expand Down Expand Up @@ -253,7 +254,13 @@ def checkFileContainsExpected(key, test_info, file_dict):
if isinstance(poss_list, type([])):
expect_type = type(poss_list[0])
# "found_param" is always a string. Convert it to match
if expect_type(found_param) >= poss_list[0] and expect_type(found_param) <= poss_list[1]:
if found_param.startswith('[') and found_param.endswith(']'):
found_param = ast.literal_eval(found_param)
for param in found_param:
if expect_type(param) >= poss_list[0] and expect_type(param) <= poss_list[1]:
found_in_list = True
break
elif expect_type(found_param) >= poss_list[0] and expect_type(found_param) <= poss_list[1]:
found_in_list = True
break
# This part gets hit for single numbers, and strings. (ie "Platform"):
Expand Down

0 comments on commit 15653f8

Please sign in to comment.