UserPyModules.CustomChecks.helper package¶
Submodules¶
UserPyModules.CustomChecks.helper.CheckAttributes module¶
- UserPyModules.CustomChecks.helper.CheckAttributes.check_attributes(test_item, check_type, config, parameters)¶
Generic attribute checker, which proceeds conditionally, depending on different test_item types
Parameters¶
test_item - Package or Project(from Object API) check_type - check type corresponding to test_item (value of enum CheckType) config - the current config.yaml object parameters - the parameters from the config.yaml for the attribute check
Returns¶
check results for unsuccessful checks as a list of CheckResult
UserPyModules.CustomChecks.helper.CheckType module¶
UserPyModules.CustomChecks.helper.ConfigKeys module¶
- class UserPyModules.CustomChecks.helper.ConfigKeys.ConditionKeys¶
Bases:
object
This class supplies all possible config condition keys used in the CustomChecks as constants.
- ENABLED = 'Enabled'¶
- PACKAGE_FOLDER = 'PackageFolder'¶
- PACKAGE_NAME = 'PackageName'¶
- PACKAGE_PROPERTIES = 'PackageProperties'¶
- PROJECT_FOLDER = 'ProjectFolder'¶
- PROJECT_NAME = 'ProjectName'¶
- REGEX_PATTERN = 'RegexPattern'¶
- TESTCASEFLAG = 'TestCaseFlag'¶
- class UserPyModules.CustomChecks.helper.ConfigKeys.ParameterKeys¶
Bases:
object
This class supplies all possible config parameter keys used in the CustomChecks as constants.
- ALLOWLIST = 'Allowlist'¶
- ALLOW_UNDEFINED = 'AllowUndefinedVariables'¶
- CHECK = 'Check'¶
- CUSTOM_MESSAGE = 'CustomMessage'¶
- DENYLIST = 'Denylist'¶
- DESCRIPTION = 'Description'¶
- FUNCTION = 'Function'¶
- LOCALVAR = 'LocalVar'¶
- MINLENGTH = 'MinLength'¶
- NAME = 'Name'¶
- NUMBER_OF_RELEVANT_CHARACTERS = 'NumberOfRelevantCharacters'¶
- ORDER = 'Order'¶
- PARAMETER = 'Parameter'¶
- REGEX_DESCRIPTION = 'RegexDescription'¶
- REGEX_PATTERN = 'RegexPattern'¶
- RETURNVALUE = 'ReturnValue'¶
- SEARCH_DEPTH = 'SearchDepth'¶
- SORT_METHOD = 'SortMethod'¶
- TESTCASEFLAG = 'TestCaseFlag'¶
- UNDEFINED = 'Undefined'¶
- VERSION = 'Version'¶
UserPyModules.CustomChecks.helper.Configuration module¶
- class UserPyModules.CustomChecks.helper.Configuration.Configuration¶
Bases:
object
A class to represent the CustomChecks configuration (config.yaml).
Attributes¶
- config_rel_pathstr
name of the check
- configlist of dict
input from yaml file
Methods¶
- get_all_checks(custom_check_name):
Return all checks from yaml
- get_check_parameters(check_name):
Return parameters
- get_check_conditions(custom_check_name, check):
Get all conditions for the given check
- get_all_checks(custom_check_name)¶
Get the list of detail check conditions.
Parameters¶
- custom_check_namestr
Name of the check.
Returns¶
dictionary with check details
- get_check_conditions(custom_check_name, check)¶
Get all conditions for the given check.
Parameters¶
- custom_check_namestr
Name of the check.
- checkdict
Dictionary with all items of the check
Returns¶
Conditions of the check
- get_check_parameters(custom_check_name, check)¶
Get all parameters for the given check.
Parameters¶
- custom_check_namestr
Name of the check.
- checkdict
Dictionary with all items of the check
Returns¶
Parameters of the check
- initialize_config(ref_config_folder='CustomChecks', ref_config_path='config.yaml', ref_config_template_path='config_template.yaml')¶
Initializes the Configuration.
Parameters¶
- ref_config_folder: str
path to the folder of the reference configuration
- ref_config_path: str
path to the reference configuration file
- ref_config_template_path: str
path to the reference template configuration file
Returns¶
tuple (object of used configuration, relative path of the used configuration)
UserPyModules.CustomChecks.helper.RunHelper module¶
- UserPyModules.CustomChecks.helper.RunHelper.check_conditions(check_name, check_object, check) bool ¶
Checks whether the conditions of the check_object to execute a specific check are fulfilled. These conditions are specified under the respective ‘Conditions’ section in the config.yaml.
Parameters¶
check_name: Current CustomCheck name check_object: ecu.test Package-Object, Project-Object from Object Api check: Current type of package that gets checked for conditions
Returns¶
True if all conditions are fulfilled for this package
- UserPyModules.CustomChecks.helper.RunHelper.get_check_activity(check)¶
Parameters¶
check: Current check configurations in config file
Returns¶
True if check is set active in config or flag is missing Check configurations with the ‘Enabled’ flag removed
- UserPyModules.CustomChecks.helper.RunHelper.package_type(check_name, check_object, check) bool ¶
Parameters¶
check_name: Current CustomCheck name check_object: ecu.test-Package-Object from Object Api check: Current type of package that gets checked for conditions
Returns¶
True if check_conditions was successful
UserPyModules.CustomChecks.helper.ecu_test_api module¶
Wrapper for importing ecu.test ApiClient of currently running ecu.test version.
- class UserPyModules.CustomChecks.helper.ecu_test_api.ObjApiProvider¶
Bases:
object
Class to inherit from to have access to the object api
- UserPyModules.CustomChecks.helper.ecu_test_api.get_api()¶
Returns an instance of the ecu.test api