Skip to content

Commit 1256193

Browse files
committed
fixes some issues with tests
1 parent 1f8fbb9 commit 1256193

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tests/unit/app/endpoints/test_query.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,10 +1762,12 @@ def test_process_knowledge_search_content_duplicate_document_id_last_wins(mocker
17621762
def test_process_knowledge_search_content_with_braces_inside_strings(mocker):
17631763
"""Test that braces inside strings are handled correctly."""
17641764
text_content_item = mocker.Mock()
1765-
text_content_item.text = """Result 1
1766-
Content: Test content
1767-
metadata: {'document_id': 'doc-100', 'title': 'A {weird} title', "
1768-
"'docs_url': 'https://example.com/100', 'extra': {'note': 'contains {braces}'}}"""
1765+
text_content_item.text = (
1766+
"Result 1\n"
1767+
"Content: Test content\n"
1768+
"Metadata: {'document_id': 'doc-100', 'title': 'A {weird} title', "
1769+
"'docs_url': 'https://example.com/100', 'extra': {'note': 'contains {braces}'}}"
1770+
)
17691771
tool_response = mocker.Mock()
17701772
tool_response.content = [text_content_item]
17711773

@@ -1779,10 +1781,12 @@ def test_process_knowledge_search_content_with_braces_inside_strings(mocker):
17791781
def test_process_knowledge_search_content_with_nested_objects(mocker):
17801782
"""Test that nested objects are parsed correctly."""
17811783
text_content_item = mocker.Mock()
1782-
text_content_item.text = """Result 1
1783-
Content: Test content
1784-
MetaData: {"document_id": "doc-200", "title": "Nested JSON", "
1785-
""docs_url": "https://example.com/200", "meta": {"k": {"inner": 1}}}"""
1784+
text_content_item.text = (
1785+
"Result 1\n"
1786+
"Content: Test content\n"
1787+
'Metadata: {"document_id": "doc-200", "title": "Nested JSON", '
1788+
'"docs_url": "https://example.com/200", "meta": {"k": {"inner": 1}}}'
1789+
)
17861790
tool_response = mocker.Mock()
17871791
tool_response.content = [text_content_item]
17881792

0 commit comments

Comments
 (0)