@@ -21,7 +21,7 @@ def test_show_version(platform, command, jpath, expected_parameter, check_should
21
21
filename = f"{ platform } _{ command } .json"
22
22
command = load_json_file ("sw_upgrade" , filename )
23
23
24
- check = CheckType .init ("parameter_match" )
24
+ check = CheckType .create ("parameter_match" )
25
25
value = check .get_value (command , jpath )
26
26
eval_results , passed = check .evaluate (value , expected_parameter , "match" ) # pylint: disable=E1121
27
27
assert passed is check_should_pass , f"FAILED, eval_result: { eval_results } "
@@ -50,7 +50,7 @@ def test_show_interfaces_state(platform, command, jpath, check_should_pass):
50
50
command_post [0 ]["link_status" ] = "down"
51
51
command_post [1 ]["protocol_status" ] = "down"
52
52
53
- check = CheckType .init ("exact_match" )
53
+ check = CheckType .create ("exact_match" )
54
54
pre_value = CheckType .get_value (command_pre , jpath )
55
55
post_value = CheckType .get_value (command_post , jpath )
56
56
eval_results , passed = check .evaluate (post_value , pre_value )
@@ -69,7 +69,7 @@ def test_show_ip_route_exact_match(platform, command):
69
69
"""Test identical route table pass the test with exact_match."""
70
70
command_pre = command_post = load_json_file ("sw_upgrade" , f"{ platform } _{ command } .json" )
71
71
72
- check = CheckType .init ("exact_match" )
72
+ check = CheckType .create ("exact_match" )
73
73
eval_results , passed = check .evaluate (command_post , command_pre )
74
74
assert passed is True , f"FAILED, eval_result: { eval_results } "
75
75
@@ -85,7 +85,7 @@ def test_show_ip_route_exact_match(platform, command):
85
85
def test_show_ip_route_missing_and_additional_routes (platform , command ):
86
86
"""Test missing or additional routes fail the test with exact_match."""
87
87
command_pre = command_post = load_json_file ("sw_upgrade" , f"{ platform } _{ command } .json" )
88
- check = CheckType .init ("exact_match" )
88
+ check = CheckType .create ("exact_match" )
89
89
print (len (command_pre ))
90
90
eval_results_missing , passed_missing = check .evaluate (command_post [:30 ], command_pre )
91
91
eval_results_additional , passed_additional = check .evaluate (command_post , command_pre [:30 ])
@@ -114,7 +114,7 @@ def test_bgp_neighbor_state(platform, command, jpath, check_should_pass):
114
114
state_key = "state" if "arista" in platform else "bgp_state"
115
115
command_post [0 ][state_key ] = "Idle"
116
116
117
- check = CheckType .init ("exact_match" )
117
+ check = CheckType .create ("exact_match" )
118
118
pre_value = CheckType .get_value (command_pre , jpath )
119
119
post_value = CheckType .get_value (command_post , jpath )
120
120
eval_results , passed = check .evaluate (post_value , pre_value )
@@ -139,7 +139,7 @@ def test_bgp_prefix_tolerance(platform, command, prfx_post_value, tolerance, che
139
139
140
140
command_post [1 ]["state_pfxrcd" ] = command_post [1 ]["state_pfxrcd" ] = prfx_post_value
141
141
142
- check = CheckType .init ("tolerance" )
142
+ check = CheckType .create ("tolerance" )
143
143
jpath = "[*].[$bgp_neigh$,state_pfxrcd]"
144
144
pre_value = CheckType .get_value (command_pre , jpath )
145
145
post_value = CheckType .get_value (command_post , jpath )
@@ -168,7 +168,7 @@ def test_ospf_neighbor_state(platform, command, jpath, check_should_pass):
168
168
command_post [0 ]["state" ] = "2WAY"
169
169
command_post = command_post [:1 ]
170
170
171
- check = CheckType .init ("exact_match" )
171
+ check = CheckType .create ("exact_match" )
172
172
pre_value = CheckType .get_value (command_pre , jpath )
173
173
post_value = CheckType .get_value (command_post , jpath )
174
174
eval_results , passed = check .evaluate (post_value , pre_value )
@@ -199,6 +199,6 @@ def test_lldp_neighbor_state(platform, command, check_should_pass):
199
199
if check_should_pass is False :
200
200
command_post = command_post [:2 ]
201
201
202
- check = CheckType .init ("exact_match" )
202
+ check = CheckType .create ("exact_match" )
203
203
eval_results , passed = check .evaluate (command_post , command_pre )
204
204
assert passed is check_should_pass , f"FAILED, eval_result: { eval_results } "
0 commit comments