(self, mock_make_request)
| 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") |
nothing calls this directly
no test coverage detected