@@ -56,22 +56,11 @@ def get_value(output: Union[Mapping, List], path: str = "*", exclude: List = Non
5656 Returns:
5757 Evaluated data, may be anything depending on JMESPath used.
5858 """
59-
60- def assert_filter_definition ():
61- """
62- Assert exclude filter definition in check.
63-
64- Exclude filter makes sense only when jmespath traverses a verbose json object.
65- In case of list of dicts - textFSM case - exclude filter is not needed.
66- See 'sw_upgrade' tests vs 'raw_novalue_exclude'.
67- """
68- if exclude and isinstance (output , Dict ):
69- if not isinstance (exclude , list ):
70- raise ValueError (f"Exclude list must be defined as a list. You have { type (exclude )} " )
71- # exclude unwanted elements
72- exclude_filter (output , exclude )
73-
74- assert_filter_definition ()
59+ if exclude and isinstance (output , Dict ):
60+ if not isinstance (exclude , list ):
61+ raise ValueError (f"Exclude list must be defined as a list. You have { type (exclude )} " )
62+ # exclude unwanted elements
63+ exclude_filter (output , exclude )
7564
7665 if not path :
7766 warnings .warn ("JMSPath cannot be empty string or type 'None'. Path argument reverted to default value '*'" )
@@ -145,7 +134,7 @@ def validate(**kwargs) -> None:
145134
146135 @staticmethod
147136 def result (evaluation_result ) -> Tuple [Dict , bool ]:
148- """Result method implementation. Will return diff data and bool for check failing result."""
137+ """Result method implementation. Will return diff data and bool for checking failed result."""
149138 return evaluation_result , not evaluation_result
150139
151140
@@ -350,3 +339,11 @@ def evaluate(self, value_to_compare: Any, params: Any) -> Tuple[Dict, bool]:
350339 reference_data = params
351340 evaluation_result = operator_evaluator (reference_data ["params" ], value_to_compare )
352341 return self .result (evaluation_result )
342+
343+ def result (self , evaluation_result ):
344+ """
345+ Operator result method overwrite.
346+
347+ This is required as Opertor return its own boolean within result.
348+ """
349+ return evaluation_result [0 ], not evaluation_result [1 ]
0 commit comments