Skip to content

jdiff.evaluators

Evaluators.

jdiff.evaluators.diff_generator(pre_result, post_result)

Generates diff between pre and post data based on check definition.

Parameters:

Name Type Description Default
pre_result Any

dataset to compare

required
post_result Any

dataset to compare

required

Returns:

Name Type Description
dict Dict

differences between two datasets with the following keys: - "values_changed": Item values that have changed - "missing": Item keys that have been removed - "new": Item keys that have been added

jdiff.evaluators.operator_evaluator(reference_data, value_to_compare)

Operator evaluator call.

jdiff.evaluators.parameter_evaluator(values, parameters, mode)

Parameter Match evaluator engine.

Parameters:

Name Type Description Default
values List[Dict]

List of items what we will check the parameters against

required
parameters Mapping

Dict with the keys and reference values to check

required
mode str

"match" or "no-match" to define the evaluation mode

required
Example

values: [{'7.7.7.7': {'peerAddress': '7.7.7.7', 'localAsn': '65130.1100', 'linkType': 'external'}}] parameters: {'localAsn': '65130.1100', 'linkType': 'external'}

Returns:

Type Description
Dict

Dictionary with all the items that have some value not matching the expectations from parameters

jdiff.evaluators.regex_evaluator(values, regex_expression, mode)

Regex Match evaluator engine.