(self, mock_client_class)
| 317 | @patch("crewai_core.plus_api._os_proxies", dict) |
| 318 | @patch("crewai_core.plus_api.httpx.Client") |
| 319 | def test_make_request(self, mock_client_class): |
| 320 | mock_client_instance = MagicMock() |
| 321 | mock_response = MagicMock() |
| 322 | mock_client_instance.request.return_value = mock_response |
| 323 | mock_client_class.return_value.__enter__.return_value = mock_client_instance |
| 324 | |
| 325 | response = self.api._make_request("GET", "test_endpoint") |
| 326 | |
| 327 | mock_client_class.assert_called_once_with( |
| 328 | verify=True, trust_env=False, mounts={} |
| 329 | ) |
| 330 | mock_client_instance.request.assert_called_once_with( |
| 331 | "GET", f"{self.api.base_url}/test_endpoint", headers=self.api.headers |
| 332 | ) |
| 333 | self.assertEqual(response, mock_response) |
| 334 | |
| 335 | @patch("crewai_core.plus_api.PlusAPI._make_request") |
| 336 | def test_deploy_by_name(self, mock_make_request): |
nothing calls this directly
no test coverage detected