@@ -1601,9 +1601,7 @@ def test_process_knowledge_search_content_with_valid_metadata(mocker):
1601
1601
tool_response = mocker .Mock ()
1602
1602
tool_response .content = [text_content_item ]
1603
1603
1604
- metadata_map = {}
1605
-
1606
- _process_knowledge_search_content (tool_response , metadata_map )
1604
+ metadata_map = _process_knowledge_search_content (tool_response )
1607
1605
1608
1606
# Verify metadata was correctly parsed and added
1609
1607
assert "doc-1" in metadata_map
@@ -1626,9 +1624,7 @@ def test_process_knowledge_search_content_with_invalid_metadata_syntax_error(moc
1626
1624
tool_response = mocker .Mock ()
1627
1625
tool_response .content = [text_content_item ]
1628
1626
1629
- metadata_map = {}
1630
-
1631
- _process_knowledge_search_content (tool_response , metadata_map )
1627
+ metadata_map = _process_knowledge_search_content (tool_response )
1632
1628
1633
1629
# Verify metadata_map remains empty due to exception
1634
1630
assert len (metadata_map ) == 0
@@ -1653,9 +1649,7 @@ def test_process_knowledge_search_content_with_invalid_metadata_value_error(mock
1653
1649
tool_response = mocker .Mock ()
1654
1650
tool_response .content = [text_content_item ]
1655
1651
1656
- metadata_map = {}
1657
-
1658
- _process_knowledge_search_content (tool_response , metadata_map )
1652
+ metadata_map = _process_knowledge_search_content (tool_response )
1659
1653
1660
1654
# Verify metadata_map remains empty due to exception
1661
1655
assert len (metadata_map ) == 0
@@ -1680,9 +1674,7 @@ def test_process_knowledge_search_content_with_non_dict_metadata(mocker):
1680
1674
tool_response = mocker .Mock ()
1681
1675
tool_response .content = [text_content_item ]
1682
1676
1683
- metadata_map = {}
1684
-
1685
- _process_knowledge_search_content (tool_response , metadata_map )
1677
+ metadata_map = _process_knowledge_search_content (tool_response )
1686
1678
1687
1679
# Verify metadata_map remains empty (no document_id in string)
1688
1680
assert len (metadata_map ) == 0
@@ -1703,9 +1695,7 @@ def test_process_knowledge_search_content_with_metadata_missing_document_id(mock
1703
1695
tool_response = mocker .Mock ()
1704
1696
tool_response .content = [text_content_item ]
1705
1697
1706
- metadata_map = {}
1707
-
1708
- _process_knowledge_search_content (tool_response , metadata_map )
1698
+ metadata_map = _process_knowledge_search_content (tool_response )
1709
1699
1710
1700
# Verify metadata_map remains empty since document_id is missing
1711
1701
assert len (metadata_map ) == 0
@@ -1719,9 +1709,7 @@ def test_process_knowledge_search_content_with_no_text_attribute(mocker):
1719
1709
tool_response = mocker .Mock ()
1720
1710
tool_response .content = [text_content_item ]
1721
1711
1722
- metadata_map = {}
1723
-
1724
- _process_knowledge_search_content (tool_response , metadata_map )
1712
+ metadata_map = _process_knowledge_search_content (tool_response )
1725
1713
1726
1714
# Verify metadata_map remains empty since text attribute is missing
1727
1715
assert len (metadata_map ) == 0
@@ -1733,9 +1721,7 @@ def test_process_knowledge_search_content_with_none_content(mocker):
1733
1721
tool_response = mocker .Mock ()
1734
1722
tool_response .content = None
1735
1723
1736
- metadata_map = {}
1737
-
1738
- _process_knowledge_search_content (tool_response , metadata_map )
1724
+ metadata_map = _process_knowledge_search_content (tool_response )
1739
1725
1740
1726
# Verify metadata_map remains empty when content is None
1741
1727
assert len (metadata_map ) == 0
0 commit comments