88
99@pytest .mark .asyncio
1010@patch ('tools.search.get_api_key_from_context' )
11- async def test_codebase_search_returns_dict (mock_get_api_key ):
12- """Test that codebase_search returns a dictionary with structured_content ."""
11+ async def test_codebase_search_returns_xml_string (mock_get_api_key ):
12+ """Test that codebase_search returns an XML string directly ."""
1313 # Mock the API key function
1414 mock_get_api_key .return_value = "test_key"
1515
@@ -56,15 +56,9 @@ async def test_codebase_search_returns_dict(mock_get_api_key):
5656 include_content = False
5757 )
5858
59- # Verify result is a dictionary
60- assert isinstance (result , dict ), "codebase_search should return a dictionary"
61-
62- # Verify it has structured_content field
63- assert "structured_content" in result , "Result should have structured_content field"
64-
65- # Verify the structured_content is a string (XML)
66- assert isinstance (result ["structured_content" ], str ), "structured_content should be a string"
59+ # Verify result is a string (XML)
60+ assert isinstance (result , str ), "codebase_search should return an XML string"
6761
6862 # Verify it contains expected XML structure
69- assert "<results>" in result [ "structured_content" ] , "Should contain results tag"
70- assert "<search_result" in result [ "structured_content" ] , "Should contain search_result tag"
63+ assert "<results>" in result , "Should contain results tag"
64+ assert "<search_result" in result , "Should contain search_result tag"
0 commit comments