(self, mock_client_class, mock_settings_class)
| 200 | @patch("crewai_core.plus_api.Settings") |
| 201 | @patch("crewai_core.plus_api.httpx.Client") |
| 202 | def test_get_tool_with_org_uuid(self, mock_client_class, mock_settings_class): |
| 203 | mock_settings = MagicMock() |
| 204 | mock_settings.org_uuid = self.org_uuid |
| 205 | mock_settings.enterprise_base_url = os.getenv('CREWAI_PLUS_URL') |
| 206 | mock_settings_class.return_value = mock_settings |
| 207 | self.api = PlusAPI(self.api_key) |
| 208 | |
| 209 | mock_client_instance = MagicMock() |
| 210 | mock_response = MagicMock() |
| 211 | mock_client_instance.request.return_value = mock_response |
| 212 | mock_client_class.return_value.__enter__.return_value = mock_client_instance |
| 213 | |
| 214 | response = self.api.get_tool("test_tool_handle") |
| 215 | |
| 216 | self.assert_request_with_org_id( |
| 217 | mock_client_instance, "GET", "/crewai_plus/api/v1/tools/test_tool_handle" |
| 218 | ) |
| 219 | self.assertEqual(response, mock_response) |
| 220 | |
| 221 | @patch("crewai_core.plus_api.PlusAPI._make_request") |
| 222 | def test_publish_tool(self, mock_make_request): |
nothing calls this directly
no test coverage detected