Skip to content

Commit 46d102c

Browse files
committed
update tests for search_repository
Signed-off-by: phernandez <[email protected]>
1 parent 8e4dc02 commit 46d102c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/repository/test_search_repository.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,14 @@ async def test_wildcard_only_search(self, search_repository, search_entity):
551551
def test_boolean_query_empty_parts_coverage(self, search_repository):
552552
"""Test Boolean query parsing with empty parts (line 143 coverage)."""
553553
# Create queries that will result in empty parts after splitting
554-
result1 = search_repository._prepare_boolean_query("hello AND AND world") # Double operator
554+
result1 = search_repository._prepare_boolean_query(
555+
"hello AND AND world"
556+
) # Double operator
555557
assert "hello" in result1 and "world" in result1
556-
558+
557559
result2 = search_repository._prepare_boolean_query(" OR test") # Leading operator
558560
assert "test" in result2
559-
561+
560562
result3 = search_repository._prepare_boolean_query("test OR ") # Trailing operator
561563
assert "test" in result3
562564

@@ -566,19 +568,19 @@ def test_parenthetical_term_quote_escaping(self, search_repository):
566568
result = search_repository._prepare_parenthetical_term('(say "hello" world)')
567569
# Should escape quotes by doubling them
568570
assert '""hello""' in result
569-
571+
570572
# Test term with single quotes
571-
result2 = search_repository._prepare_parenthetical_term('(it\'s working)')
573+
result2 = search_repository._prepare_parenthetical_term("(it's working)")
572574
assert "it's working" in result2
573575

574576
def test_needs_quoting_empty_input(self, search_repository):
575577
"""Test _needs_quoting with empty inputs (line 207 coverage)."""
576578
# Test empty string
577579
assert not search_repository._needs_quoting("")
578-
580+
579581
# Test whitespace-only string
580582
assert not search_repository._needs_quoting(" ")
581-
583+
582584
# Test None-like cases
583585
assert not search_repository._needs_quoting("\t")
584586

@@ -587,11 +589,11 @@ def test_prepare_single_term_empty_input(self, search_repository):
587589
# Test empty string
588590
result1 = search_repository._prepare_single_term("")
589591
assert result1 == ""
590-
592+
591593
# Test whitespace-only string
592594
result2 = search_repository._prepare_single_term(" ")
593595
assert result2 == " " # Should return as-is
594-
596+
595597
# Test string that becomes empty after strip
596598
result3 = search_repository._prepare_single_term("\t\n")
597599
assert result3 == "\t\n" # Should return original

0 commit comments

Comments
 (0)