def _build_context(self, results): return { "now": datetime.datetime.now().replace(microsecond=0), "project_name": settings.get("project-name", ""), "results": results, "session": session, }
def hide_sensitive_info(response): report_settings = settings.get("report", {}) request = response.request request_settings = report_settings.get("hide-request", {}) response_settings = report_settings.get("hide-response", {}) _hide(request, request_settings) _hide(response, response_settings)
def hide_sensitive_info(response): """ Takes response and begins the hiding of sensitive data process """ report_settings = settings.get("report", {}) request = response.request request_settings = report_settings.get("hide_request", {}) response_settings = report_settings.get("hide_response", {}) _hide(request, request_settings) _hide(response, response_settings)
def _build_context(results): """ Private method of Reporter returns dict containing keys datetime, project_name, results and session and their corresponding values. """ return { "now": datetime.datetime.now().replace(microsecond=0), "project_name": settings.get("project_name", ""), "results": results, "session": session, }
def _build_context(results): """Build context dict of values required to render template. Args: results [generator]: generator of dicts resulting of Request run(). Returns: [dict]: values required to render template. """ return { "now": datetime.datetime.now().replace(microsecond=0), "project_name": settings.get("project_name", ""), "results": results, "session": session, "scanapi_version": get_distribution("scanapi").version, }
def hide_sensitive_info(response): """Takes response and hides the sensitive data replacing the info with the string `SENSITIVE_INFORMATION`. Args: response [requests.models.Response]: the response that has information to be hidden. """ report_settings = settings.get("report", {}) request = response.request request_settings = report_settings.get("hide_request", {}) response_settings = report_settings.get("hide_response", {}) _hide(request, request_settings) _hide(response, response_settings)