Skip to content

Commit b7ed34e

Browse files
author
Patryk Szulczewski
committed
rebased on main
1 parent 39a0486 commit b7ed34e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

netcompare/check_type.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def init(*args):
2424
raise NotImplementedError
2525

2626
@staticmethod
27-
def get_value(
28-
value: Mapping, path: Mapping, exclude: List = None
29-
) -> Union[Mapping, List, int, str, bool]:
27+
def get_value(value: Mapping, path: Mapping, exclude: List = None) -> Union[Mapping, List, int, str, bool]:
3028
"""Return the value contained into a Mapping for a defined path."""
3129
return extract_values_from_output(value, path, exclude)
3230

File renamed without changes.

tests/test_type_check.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"Check Type unit tests."
22
import pytest
33
from netcompare.check_type import CheckType, ExactMatchType, ToleranceType
4-
from .utility import load_mocks, ASSERT_FAIL_MESSAGE
4+
from .utility import load_json_file, load_mocks, ASSERT_FAIL_MESSAGE
55

66

77
@pytest.mark.parametrize(
@@ -163,7 +163,7 @@ def test_checks(folder_name, check_args, path, expected_result):
163163

164164

165165
parameter_match_api = (
166-
"parameter_match.json",
166+
"pre.json",
167167
("parameter_match", {"localAsn": "65130.1100", "linkType": "external"}),
168168
"result[0].vrfs.default.peerList[*].[$peerAddress$,localAsn,linkType]",
169169
(
@@ -181,7 +181,9 @@ def test_param_match(filename, check_args, path, expected_result):
181181
"""Validate parameter_match check type."""
182182
check = CheckType.init(*check_args)
183183
# There is not concept of "pre" and "post" in parameter_match.
184-
data = load_json_file("pre", filename)
184+
data = load_json_file("parameter_match", filename)
185185
value = check.get_value(data, path)
186186
actual_results = check.evaluate(value, check_args)
187-
assert actual_results == expected_result
187+
assert actual_results == expected_result, ASSERT_FAIL_MESSAGE.format(
188+
output=actual_results, expected_output=expected_result
189+
)

0 commit comments

Comments
 (0)