Skip to content

Commit

Permalink
Update range query parser test
Browse files Browse the repository at this point in the history
Updates the range query parser test to match current functionality/changes
  • Loading branch information
ItIsJordan committed Dec 3, 2024
1 parent b62f548 commit 946e749
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/search_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_query_parser():
parsed_query_string7 = HEPDataQueryParser.parse_query(_test_query7)
assert (parsed_query_string7 == 'recid:1')

def test_verify_range_query_term():
def test_parse_range_query():
"""
Tests the range query verification function to ensure that parsed queries are
correctly returning the range term list, and the data search table exclusion status.
Expand Down Expand Up @@ -257,8 +257,10 @@ def test_verify_range_query_term():
for query in test["query_strings"]:
# Execute the verification with current string
result = HEPDataQueryParser.parse_range_query(query)
# Doing the same term replacement required for OpenSearch
parsed_query = query.replace("publication_recid", "recid")
# Expected result based on which test object we are on
assert result == (test["expected_result"], test["exclude_tables"])
assert result == (test["expected_result"], test["exclude_tables"], parsed_query)


def test_search(app, load_default_data, identifiers):
Expand Down

0 comments on commit 946e749

Please sign in to comment.