From 946e74976e6e1f1b26b1c316cc2ddb75aa718748 Mon Sep 17 00:00:00 2001 From: Jordan <21129425+ItIsJordan@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:26:19 +0000 Subject: [PATCH] Update range query parser test Updates the range query parser test to match current functionality/changes --- tests/search_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/search_test.py b/tests/search_test.py index 33eec31a..1ef66a84 100644 --- a/tests/search_test.py +++ b/tests/search_test.py @@ -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. @@ -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):