Skip to content

jdiff.check_types

CheckType Implementation.

jdiff.check_types.CheckType

Bases: ABC

Check Type Base Abstract Class.

create(check_type) staticmethod

Factory pattern to get the appropriate CheckType implementation.

Parameters:

Name Type Description Default
check_type str

String to define the type of check.

required

evaluate(*args, **kwargs) abstractmethod

Return the result of the evaluation and a boolean True if it passes it or False otherwise.

This method is the one that each CheckType has to implement.

Parameters:

Name Type Description Default
*args tuple

arguments specific to child class implementation

()
**kwargs dict

named arguments

{}

Returns:

Name Type Description
tuple Tuple[Dict, bool]

Dictionary representing check result, bool indicating if differences are found.

result(evaluation_result) staticmethod

Result method implementation. Will return diff data and bool for checking failed result.

jdiff.check_types.ExactMatchType

Bases: CheckType

Exact Match class docstring.

evaluate(reference_data, value_to_compare)

Returns the difference between values and the boolean.

jdiff.check_types.OperatorType

Bases: CheckType

Operator class implementation.

evaluate(params, value_to_compare)

Operator evaluator implementation.

result(evaluation_result)

Operator result method overwrite.

This is required as Opertor return its own boolean within result.

jdiff.check_types.ParameterMatchType

Bases: CheckType

Parameter Match class implementation.

evaluate(params, value_to_compare, mode)

Parameter Match evaluator implementation.

jdiff.check_types.RegexType

Bases: CheckType

Regex Match class implementation.

evaluate(regex, value_to_compare, mode)

Regex Match evaluator implementation.

jdiff.check_types.ToleranceType

Bases: CheckType

Tolerance class docstring.

evaluate(reference_data, value_to_compare, tolerance)

Returns the difference between values and the boolean. Overwrites method in base class.