From 87675b49fd8f16caa123f2ebe2270c90adacc235 Mon Sep 17 00:00:00 2001 From: Rip&Tear <84775494+theCyberTech@users.noreply.github.com> Date: Wed, 11 Feb 2026 14:32:10 +0800 Subject: [PATCH] test: avoid URL substring assertion in brave search test (#4453) --- lib/crewai-tools/tests/tools/brave_search_tool_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/crewai-tools/tests/tools/brave_search_tool_test.py b/lib/crewai-tools/tests/tools/brave_search_tool_test.py index 361086abe..6e1300622 100644 --- a/lib/crewai-tools/tests/tools/brave_search_tool_test.py +++ b/lib/crewai-tools/tests/tools/brave_search_tool_test.py @@ -33,8 +33,11 @@ def test_brave_tool_search(mock_get, brave_tool): mock_get.return_value.json.return_value = mock_response result = brave_tool.run(query="test") - assert "Test Title" in result - assert "http://test.com" in result + data = json.loads(result) + assert isinstance(data, list) + assert len(data) >= 1 + assert data[0]["title"] == "Test Title" + assert data[0]["url"] == "http://test.com" @patch("requests.get")