validations_engine package¶
Submodules¶
Slack communications module.
- class validations_engine.SlackHelper.SlackHelper¶
Bases:
object
Slack Helper class.
- static build_slack_payload(error_messages: List[Tuple[str, str]]) Dict[str, Dict[str, Any]] ¶
Builds the message payload from the error messages.
- static send_slack_errors(error_messages: List[Tuple[str, str]]) bool ¶
Sends errors messages to Slack (channels).
- Returns
flag stating if messages were sent or not
Suites base executor.
- class validations_engine.base_validation_suites_executor.BaseValidationSuitesExecutor(auth: Optional[Dict[str, Any]] = None)¶
Bases:
object
Validation suites executors abstract class.
- SLACK_MSG_HEADER = ''¶
- get_suite_validation_failures_messages() List[Tuple[str, str]] ¶
Return the errors list.
- get_suite_validation_has_failures() bool ¶
Returns the bool state indicating if there were failures.
- run() None ¶
Main method executed by the validation suites (E.g.: FooValidationSuite).
- It will run every method prefixed with validation_ defined in the validation
suite class. And the default ones defined in the executor class.
Only stops when all validations are finished.
Validations Engine main class.
- class validations_engine.validations_engine.ValidationsEngine(validations_suites_root_path: str)¶
Bases:
object
The Validator engine main file.
- This class is responsible for parsing all validation suites and running
its validation methods individually.
- handle_errors() None ¶
Ensures (raises) a failure in the end of all validations.
- load_validation_suites(validations_suites_root_path: str) List[BaseValidationSuitesExecutor] ¶
Import suites’ modules and loads a list with their classes.
- Get each suite file, imports it as a python module and loads the
suite class.
- run_validation_suites() None ¶
The main method.
- Runs all validations from Suite classes and raises an error if some
validation failed.
- set_connections_auth_params(connections_auth_params: Dict[str, Any]) None ¶
Setter of connections_auth_params.
- set_suites_have_failures(param: bool, messages: Optional[List[str]] = None) None ¶
Merges previous state with new one.
Module contents¶
Top-level package for validations_engine.