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

Method test_make_request

lib/cli/tests/test_plus_api.py:319–333  ·  view source on GitHub ↗
(self, mock_client_class)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

_make_requestMethod · 0.45

Tested by

no test coverage detected