Skip to content

Commit

Permalink
absoluteOrbit list check in csv works
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed May 6, 2024
1 parent 9f6fa28 commit 70eba65
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions yml_tests/test_url_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def checkFileContainsExpected(key, test_info, file_dict):
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]:
if param >= poss_list[0] and 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]:
Expand All @@ -266,7 +266,20 @@ def checkFileContainsExpected(key, test_info, file_dict):
# This part gets hit for single numbers, and strings. (ie "Platform"):
else:
expect_type = type(poss_list)
if expect_type(found_param) == poss_list:
if isinstance(found_param, str) and found_param.startswith('[') and found_param.endswith(']'):
# expect_type = type(poss_list)
found_param = ast.literal_eval(found_param)
for param in found_param:
if param == poss_list:
# if expect_type(param) >= poss_list[0] and expect_type(param) <= poss_list[1]:
found_in_list = True
break
elif isinstance(found_param, list):
for param in found_param:
if param == poss_list:
found_in_list = True
break
elif expect_type(found_param) == poss_list:
found_in_list = True
break
# If inner for-loop found it, break out of this one too:
Expand Down

0 comments on commit 70eba65

Please sign in to comment.