(self, mock_client_class, mock_settings_class)
| 85 | @patch("crewai_core.plus_api.Settings") |
| 86 | @patch("crewai_core.plus_api.httpx.Client") |
| 87 | def test_get_tool_with_org_uuid(self, mock_client_class, mock_settings_class): |
| 88 | mock_settings = MagicMock() |
| 89 | mock_settings.org_uuid = self.org_uuid |
| 90 | mock_settings.enterprise_base_url = os.getenv('CREWAI_PLUS_URL') |
| 91 | mock_settings_class.return_value = mock_settings |
| 92 | self.api = PlusAPI(self.api_key) |
| 93 | |
| 94 | mock_client_instance = MagicMock() |
| 95 | mock_response = MagicMock() |
| 96 | mock_client_instance.request.return_value = mock_response |
| 97 | mock_client_class.return_value.__enter__.return_value = mock_client_instance |
| 98 | |
| 99 | response = self.api.get_tool("test_tool_handle") |
| 100 | |
| 101 | self.assert_request_with_org_id( |
| 102 | mock_client_instance, "GET", "/crewai_plus/api/v1/tools/test_tool_handle" |
| 103 | ) |
| 104 | self.assertEqual(response, mock_response) |
| 105 | |
| 106 | @patch("crewai_core.plus_api.PlusAPI._make_request") |
| 107 | def test_publish_tool(self, mock_make_request): |
nothing calls this directly
no test coverage detected