@@ -129,7 +129,7 @@ def evaluate(self, *args, **kwargs) -> Tuple[Dict, bool]:
129
129
130
130
@staticmethod
131
131
@abstractmethod
132
- def validate (** kwargs ) -> None :
132
+ def _validate (** kwargs ) -> None :
133
133
"""Method to validate arguments that raises proper exceptions."""
134
134
135
135
@staticmethod
@@ -142,13 +142,13 @@ class ExactMatchType(CheckType):
142
142
"""Exact Match class docstring."""
143
143
144
144
@staticmethod
145
- def validate (** kwargs ) -> None :
145
+ def _validate (** kwargs ) -> None :
146
146
"""Method to validate arguments."""
147
147
# reference_data = getattr(kwargs, "reference_data")
148
148
149
149
def evaluate (self , value_to_compare : Any , reference_data : Any ) -> Tuple [Dict , bool ]:
150
150
"""Returns the difference between values and the boolean."""
151
- self .validate (reference_data = reference_data )
151
+ self ._validate (reference_data = reference_data )
152
152
evaluation_result = diff_generator (reference_data , value_to_compare )
153
153
return self .result (evaluation_result )
154
154
@@ -157,7 +157,7 @@ class ToleranceType(CheckType):
157
157
"""Tolerance class docstring."""
158
158
159
159
@staticmethod
160
- def validate (** kwargs ) -> None :
160
+ def _validate (** kwargs ) -> None :
161
161
"""Method to validate arguments."""
162
162
# reference_data = getattr(kwargs, "reference_data")
163
163
tolerance = kwargs .get ("tolerance" )
@@ -170,7 +170,7 @@ def validate(**kwargs) -> None:
170
170
171
171
def evaluate (self , value_to_compare : Any , reference_data : Any , tolerance : int ) -> Tuple [Dict , bool ]:
172
172
"""Returns the difference between values and the boolean. Overwrites method in base class."""
173
- self .validate (reference_data = reference_data , tolerance = tolerance )
173
+ self ._validate (reference_data = reference_data , tolerance = tolerance )
174
174
evaluation_result = diff_generator (reference_data , value_to_compare )
175
175
self ._remove_within_tolerance (evaluation_result , tolerance )
176
176
return self .result (evaluation_result )
@@ -206,7 +206,7 @@ class ParameterMatchType(CheckType):
206
206
"""Parameter Match class implementation."""
207
207
208
208
@staticmethod
209
- def validate (** kwargs ) -> None :
209
+ def _validate (** kwargs ) -> None :
210
210
"""Method to validate arguments."""
211
211
mode_options = ["match" , "no-match" ]
212
212
params = kwargs .get ("params" )
@@ -225,7 +225,7 @@ def validate(**kwargs) -> None:
225
225
226
226
def evaluate (self , value_to_compare : Mapping , params : Dict , mode : str ) -> Tuple [Dict , bool ]:
227
227
"""Parameter Match evaluator implementation."""
228
- self .validate (params = params , mode = mode )
228
+ self ._validate (params = params , mode = mode )
229
229
# TODO: we don't use the mode?
230
230
evaluation_result = parameter_evaluator (value_to_compare , params , mode )
231
231
return self .result (evaluation_result )
@@ -235,7 +235,7 @@ class RegexType(CheckType):
235
235
"""Regex Match class implementation."""
236
236
237
237
@staticmethod
238
- def validate (** kwargs ) -> None :
238
+ def _validate (** kwargs ) -> None :
239
239
"""Method to validate arguments."""
240
240
mode_options = ["match" , "no-match" ]
241
241
regex = kwargs .get ("regex" )
@@ -252,7 +252,7 @@ def validate(**kwargs) -> None:
252
252
253
253
def evaluate (self , value_to_compare : Mapping , regex : str , mode : str ) -> Tuple [Mapping , bool ]:
254
254
"""Regex Match evaluator implementation."""
255
- self .validate (regex = regex , mode = mode )
255
+ self ._validate (regex = regex , mode = mode )
256
256
evaluation_result = regex_evaluator (value_to_compare , regex , mode )
257
257
return self .result (evaluation_result )
258
258
@@ -261,7 +261,7 @@ class OperatorType(CheckType):
261
261
"""Operator class implementation."""
262
262
263
263
@staticmethod
264
- def validate (** kwargs ) -> None :
264
+ def _validate (** kwargs ) -> None :
265
265
"""Validate operator parameters."""
266
266
in_operators = ("is-in" , "not-in" , "in-range" , "not-range" )
267
267
bool_operators = ("all-same" ,)
@@ -334,7 +334,7 @@ def validate(**kwargs) -> None:
334
334
335
335
def evaluate (self , value_to_compare : Any , params : Any ) -> Tuple [Dict , bool ]:
336
336
"""Operator evaluator implementation."""
337
- self .validate (** params )
337
+ self ._validate (** params )
338
338
# For name consistency.
339
339
reference_data = params
340
340
evaluation_result = operator_evaluator (reference_data ["params" ], value_to_compare )
0 commit comments