MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / test_publish_tool

Method test_publish_tool

lib/cli/tests/test_plus_api.py:222–247  ·  view source on GitHub ↗
(self, mock_make_request)

Source from the content-addressed store, hash-verified

220
221 @patch("crewai_core.plus_api.PlusAPI._make_request")
222 def test_publish_tool(self, mock_make_request):
223 mock_response = MagicMock()
224 mock_make_request.return_value = mock_response
225 handle = "test_tool_handle"
226 public = True
227 version = "1.0.0"
228 description = "Test tool description"
229 encoded_file = "encoded_test_file"
230
231 response = self.api.publish_tool(
232 handle, public, version, description, encoded_file
233 )
234
235 params = {
236 "handle": handle,
237 "public": public,
238 "version": version,
239 "file": encoded_file,
240 "description": description,
241 "available_exports": None,
242 "tools_metadata": None,
243 }
244 mock_make_request.assert_called_once_with(
245 "POST", "/crewai_plus/api/v1/tools", json=params
246 )
247 self.assertEqual(response, mock_response)
248
249 @patch("crewai_core.plus_api.Settings")
250 @patch("crewai_core.plus_api.httpx.Client")

Callers

nothing calls this directly

Calls 1

publish_toolMethod · 0.80

Tested by

no test coverage detected