this is the api @router.get("/account/leads") def getaccountslead( dbsession: DbSession,…
- User
this is the api
@router.get("/account/leads") def get_accounts_lead( db_session: DbSession, request: Request, query_param: UuidCheck = Depends(), ): try: account_id = query_param.account_id return accounts_lead( db_session=db_session, sponsor_id=get_sponsor_id_from_request(request), account_id=account_id, ) except OperationalError as err: return get_error_response( message=err.args[0], errorCode=HTTP_EXCEPTIONS["ERROR_432"], data=err ) except HTTPException as httpException: log.error(f"{ACCOUNTS_LEADS_ERROR_MESSAGE} : {httpException}") except Exception as err: log.error(f"{ACCOUNTS_LEADS_ERROR_MESSAGE} : {err}") return get_error_response(INSIGHTS_SUMMARY_API_FAIL_COMMON_ERROR_MESSAGE, 500) finally: db_session.close()
this is the test case @patch("src.app.accounts.view.accounts_lead") def test_view_get_accounts_lead(self, mock_obj: Mock): """ unittest for get_accounts_lead :param mock_obj: mock object for patching accounts_lead """ response = {"status": "success", "message": "message", "data": []} response = JSONResponse( content=jsonable_encoder(response), headers={"Content-Type": "application/json"}, status_code=200, ) mock_obj.return_value = response query_param = Mock() query_param.account_id = uuid4() request = Mock() db_session = Mock()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.