Skip to content

Commit b57dbc6

Browse files
authored
Merge pull request #56 from networktocode-llc/lvrfrc87
fix return from operator check
2 parents 7a96e5b + 30aef5f commit b57dbc6

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

netcompare/check_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,5 @@ def evaluate(self, value_to_compare: Any, params: Any) -> Tuple[Mapping, bool]:
326326
self.validate(**params)
327327
# For name consistency.
328328
reference_data = params
329-
return operator_evaluator(reference_data["params"], value_to_compare)
329+
evaluation_result, evaluation_bool = operator_evaluator(reference_data["params"], value_to_compare)
330+
return evaluation_result, not evaluation_bool

tests/test_operators.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
}
4040
},
4141
],
42-
False,
42+
True,
4343
),
4444
)
4545
operator_contains = (
4646
"pre.json",
4747
"operator",
4848
{"params": {"mode": "contains", "operator_data": "EVPN"}},
4949
"result[0].vrfs.default.peerList[*].[$peerAddress$,peerGroup]",
50-
([{"7.7.7.7": {"peerGroup": "EVPN-OVERLAY-SPINE"}}], True),
50+
([{"7.7.7.7": {"peerGroup": "EVPN-OVERLAY-SPINE"}}], False),
5151
)
5252
operator_not_contains = (
5353
"pre.json",
@@ -60,7 +60,7 @@
6060
{"10.2.0.0": {"peerGroup": "IPv4-UNDERLAY-SPINE"}},
6161
{"10.64.207.255": {"peerGroup": "IPv4-UNDERLAY-MLAG-PEER"}},
6262
],
63-
True,
63+
False,
6464
),
6565
)
6666
operator_is_gt = (
@@ -75,7 +75,7 @@
7575
{"10.2.0.0": {"prefixesSent": 50}},
7676
{"10.64.207.255": {"prefixesSent": 50}},
7777
],
78-
True,
78+
False,
7979
),
8080
)
8181
operator_is_lt = (
@@ -90,7 +90,7 @@
9090
{"10.2.0.0": {"prefixesSent": 50}},
9191
{"10.64.207.255": {"prefixesSent": 50}},
9292
],
93-
True,
93+
False,
9494
),
9595
)
9696
operator_is_in = (
@@ -105,7 +105,7 @@
105105
{"10.2.0.0": {"prefixesSent": 50}},
106106
{"10.64.207.255": {"prefixesSent": 50}},
107107
],
108-
True,
108+
False,
109109
),
110110
)
111111
operator_not_in = (
@@ -120,7 +120,7 @@
120120
{"10.2.0.0": {"prefixesSent": 50}},
121121
{"10.64.207.255": {"prefixesSent": 50}},
122122
],
123-
True,
123+
False,
124124
),
125125
)
126126
operator_in_range = (
@@ -135,7 +135,7 @@
135135
{"10.2.0.0": {"prefixesSent": 50}},
136136
{"10.64.207.255": {"prefixesSent": 50}},
137137
],
138-
True,
138+
False,
139139
),
140140
)
141141
operator_not_in_range = (
@@ -150,7 +150,7 @@
150150
{"10.2.0.0": {"prefixesSent": 50}},
151151
{"10.64.207.255": {"prefixesSent": 50}},
152152
],
153-
True,
153+
False,
154154
),
155155
)
156156

0 commit comments

Comments
 (0)