@@ -301,7 +301,7 @@ def test_paren_expression_with_bool_disabled(self):
301
301
def test_paren_expression_to_query_string (self ):
302
302
(val ,) = parse_search_query ("(has:1 random():<5)" )
303
303
assert isinstance (val , ParenExpression )
304
- assert val .to_query_string () == "(has:=1 random():<5.0)" # type: ignore[unreachable] # will be fixed once parse_search_query is fixed!
304
+ assert val .to_query_string () == "(has:=1 random():<5.0)"
305
305
306
306
def test_bool_operator_with_bool_disabled (self ):
307
307
config = SearchConfig .create_from (default_config , allow_boolean = False )
@@ -852,6 +852,7 @@ def test_escaping_asterisk(self):
852
852
]
853
853
search_filter = search_filters [0 ]
854
854
# the slash should be removed in the final value
855
+ assert isinstance (search_filter , SearchFilter )
855
856
assert search_filter .value .value == "a*b"
856
857
857
858
# the first and last asterisks arent escaped with a preceding backslash, so they're
@@ -861,6 +862,7 @@ def test_escaping_asterisk(self):
861
862
SearchFilter (key = SearchKey (name = "title" ), operator = "=" , value = SearchValue (r"*\**" ))
862
863
]
863
864
search_filter = search_filters [0 ]
865
+ assert isinstance (search_filter , SearchFilter )
864
866
assert search_filter .value .value == r"^.*\*.*$"
865
867
866
868
@pytest .mark .xfail (reason = "escaping backslashes is not supported yet" )
@@ -871,6 +873,7 @@ def test_escaping_backslashes(self):
871
873
]
872
874
search_filter = search_filters [0 ]
873
875
# the extra slash should be removed in the final value
876
+ assert isinstance (search_filter , SearchFilter )
874
877
assert search_filter .value .value == r"a\b"
875
878
876
879
@pytest .mark .xfail (reason = "escaping backslashes is not supported yet" )
@@ -881,6 +884,7 @@ def test_trailing_escaping_backslashes(self):
881
884
]
882
885
search_filter = search_filters [0 ]
883
886
# the extra slash should be removed in the final value
887
+ assert isinstance (search_filter , SearchFilter )
884
888
assert search_filter .value .value == "a\\ "
885
889
886
890
def test_escaping_quotes (self ):
@@ -890,6 +894,7 @@ def test_escaping_quotes(self):
890
894
]
891
895
search_filter = search_filters [0 ]
892
896
# the slash should be removed in the final value
897
+ assert isinstance (search_filter , SearchFilter )
893
898
assert search_filter .value .value == 'a"b'
894
899
895
900
@@ -941,6 +946,7 @@ def test_search_filter_to_query_string(query):
941
946
942
947
filters = parse_search_query (query )
943
948
assert len (filters ) == 1
949
+ assert isinstance (filters [0 ], SearchFilter )
944
950
actual = filters [0 ].to_query_string ()
945
951
assert actual == query
946
952
0 commit comments