From f6a95b4c331a968060d3c4908f60cd634fd02950 Mon Sep 17 00:00:00 2001 From: "MoessnerFabian(Group)" Date: Wed, 18 Dec 2024 10:34:18 +0100 Subject: [PATCH] Straighten up tests --- tests/unit/filter/test_lucene_filter.py | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/unit/filter/test_lucene_filter.py b/tests/unit/filter/test_lucene_filter.py index cd03b8792..67764b0cb 100644 --- a/tests/unit/filter/test_lucene_filter.py +++ b/tests/unit/filter/test_lucene_filter.py @@ -458,7 +458,7 @@ def test_create_filter_error(self, testcase, input_str, message): def test_creates_lucene_compliance_filter_two_matching_regex_keys_of_two(self): lucene_filter = LuceneFilter.create( - 'regex_key_one: "/.*value.*/" AND regex_key_two: "/.*value.*/"', + 'regex_key_one: /.*value.*/ AND regex_key_two: /.*value.*/', ) assert lucene_filter == And( @@ -466,38 +466,21 @@ def test_creates_lucene_compliance_filter_two_matching_regex_keys_of_two(self): RegExFilterExpression(["regex_key_two"], ".*value.*"), ) - def test_creates_lucene_compliance_filter_one_regex_key(self): + def test_creates_StringFilter_not_Regex(self): lucene_filter = LuceneFilter.create( 'regex_key_one: "/.*value.*/"', ) - assert lucene_filter == RegExFilterExpression(["regex_key_one"], ".*value.*") - - def test_creates_lucene_compliance_filter_one_matching_one_missmatch_regex_key_of_two(self): - lucene_filter = LuceneFilter.create( - 'regex_key_one: "/.*value.*/" AND key_two: "value"', - ) - - assert lucene_filter == And( - RegExFilterExpression(["regex_key_one"], ".*value.*"), - StringFilterExpression(["key_two"], "value"), - ) + assert lucene_filter == StringFilterExpression(["regex_key_one"], "/.*value.*/") def test_new_lucene_compliance(self): - lucene_filter = LuceneFilter.create( - 'regex_key_one:".*value.*"' - ) - - assert lucene_filter == RegExFilterExpression(["regex_key_one"], ".*value.*") - - def test_new_lucene_compliance2(self): lucene_filter = LuceneFilter.create( 'regex_key_one:/.*value.*/' ) assert lucene_filter == RegExFilterExpression(["regex_key_one"], ".*value.*") - def test_new_lucene_compliance3(self): + def test_creates_lucene_compliance_filter_one_matching_one_missmatch_regex_key_of_two2(self): lucene_filter = LuceneFilter.create( 'regex_key_one:/.*value.*/ AND key_two: "/.*value.*/"', )