You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* draft regex base function
* fix file import
* draft regex implementation
* fix logic into regex result
* remove assertion
* draft test for range check type
* add match/no-match logic
* commit save
* add assertion for check option
* add assertions for range type
* add assertion for strings
* commit save
* draft operator check type
* complete validate method for check_type operator
* work on oeprator_evaluator method
* drat operator all-same
* add all-same operator
* add contains operator
* add not-contains. Update contains logic
* add is-gt and is-lt operators
* add range operators
* add operator lib for DRY code
* fix some lint errors
* Update netcompare/operator.py
Not sure about this...if you look at the if statements, your suggestion would brake the logic...or am I missing something?
Co-authored-by: Patryk Szulczewski <[email protected]>
* work on comments
* working on operator args
* fix tests
* improve validator switch logic
* fix pytests
Co-authored-by: Patryk Szulczewski <[email protected]>
f"'params' value must be one of the following: {[sub_elementforelementinvalid_optionsforsub_elementinelement]}. You have: {params_key}"
262
+
)
263
+
264
+
ifparams_keyinin_operators:
265
+
# "is-in", "not-in", "in-range", "not-range" requires an iterable
266
+
ifnotisinstance(params_value, (list, tuple)):
267
+
raiseValueError(
268
+
f"Range check-option {in_operators} must have value of type list or tuple. i.e: dict(not-in=('Idle', 'Down'). You have: {params_value} of type {type(params_value)}You have: {params_value} of type {type(params_value)}"
269
+
)
270
+
271
+
# "in-range", "not-range" requires int or float where value at index 0 is lower than value at index 1
f"Range check-option {params_key} must have value of type list or tuple with items of type float or int. i.e: dict(not-range=(70000000, 80000000). You have: {params_value} of type {type(params_value)}"
276
+
)
277
+
ifnotparams_value[0] <params_value[1]:
278
+
raiseValueError(
279
+
f"'range' and 'not-range' must have value at index 0 lower than value at index 1. i.e: dict(not-range=(70000000, 80000000). You have: {params_value} of type {type(params_value)}"
f"Range check-option {string_operators} must have value of type string. i.e: dict(contains='EVPN'). You have: {params_value} of type {type(params_value)}"
0 commit comments