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
* tolerance validate tests
* add validate parameter test
* add mode to param match check type
* add regex validate tests
* working on operator validato tests
* complete validate tests for operator
* paramet tests
* Update as per comments
* fix as in comment PR
Co-authored-by: Patryk Szulczewski <[email protected]>
# "is-in", "not-in", "in-range", "not-range" requires an iterable
266
270
ifnotisinstance(params_value, (list, tuple)):
267
271
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)}"
272
+
f"check options {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)}."
269
273
)
270
274
271
275
# "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)}"
283
+
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}."
276
284
)
277
285
ifnotparams_value[0] <params_value[1]:
278
286
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)}"
287
+
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}."
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)}"
299
+
f"check options {string_operators} must have value of type string. You have: {params_value} of type {type(params_value)}"
"'params' value must be one of the following: ['is-in', 'not-in', 'in-range', 'not-range', 'all-same', 'is-gt', 'is-lt', 'contains', 'not-contains']. You have: random",
"check options ('is-in', 'not-in', 'in-range', 'not-range') must have value of type list or tuple. i.e: dict(not-in=('Idle', 'Down'). You have: string of type <class 'str'>.",
"'range' check-option in-range must have value of type list or tuple with items of type float or int. i.e: dict(not-range=(70000000, 80000000). You have: (0, '1').",
0 commit comments