@@ -21,7 +21,7 @@ def test_show_version(platform, command, jpath, expected_parameter, check_should
2121 filename = f"{ platform } _{ command } .json"
2222 command = load_json_file ("sw_upgrade" , filename )
2323
24- check = CheckType .init ("parameter_match" )
24+ check = CheckType .create ("parameter_match" )
2525 value = check .get_value (command , jpath )
2626 eval_results , passed = check .evaluate (value , expected_parameter , "match" ) # pylint: disable=E1121
2727 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):
5050 command_post [0 ]["link_status" ] = "down"
5151 command_post [1 ]["protocol_status" ] = "down"
5252
53- check = CheckType .init ("exact_match" )
53+ check = CheckType .create ("exact_match" )
5454 pre_value = CheckType .get_value (command_pre , jpath )
5555 post_value = CheckType .get_value (command_post , jpath )
5656 eval_results , passed = check .evaluate (post_value , pre_value )
@@ -69,7 +69,7 @@ def test_show_ip_route_exact_match(platform, command):
6969 """Test identical route table pass the test with exact_match."""
7070 command_pre = command_post = load_json_file ("sw_upgrade" , f"{ platform } _{ command } .json" )
7171
72- check = CheckType .init ("exact_match" )
72+ check = CheckType .create ("exact_match" )
7373 eval_results , passed = check .evaluate (command_post , command_pre )
7474 assert passed is True , f"FAILED, eval_result: { eval_results } "
7575
@@ -85,7 +85,7 @@ def test_show_ip_route_exact_match(platform, command):
8585def test_show_ip_route_missing_and_additional_routes (platform , command ):
8686 """Test missing or additional routes fail the test with exact_match."""
8787 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" )
8989 print (len (command_pre ))
9090 eval_results_missing , passed_missing = check .evaluate (command_post [:30 ], command_pre )
9191 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):
114114 state_key = "state" if "arista" in platform else "bgp_state"
115115 command_post [0 ][state_key ] = "Idle"
116116
117- check = CheckType .init ("exact_match" )
117+ check = CheckType .create ("exact_match" )
118118 pre_value = CheckType .get_value (command_pre , jpath )
119119 post_value = CheckType .get_value (command_post , jpath )
120120 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
139139
140140 command_post [1 ]["state_pfxrcd" ] = command_post [1 ]["state_pfxrcd" ] = prfx_post_value
141141
142- check = CheckType .init ("tolerance" )
142+ check = CheckType .create ("tolerance" )
143143 jpath = "[*].[$bgp_neigh$,state_pfxrcd]"
144144 pre_value = CheckType .get_value (command_pre , jpath )
145145 post_value = CheckType .get_value (command_post , jpath )
@@ -168,7 +168,7 @@ def test_ospf_neighbor_state(platform, command, jpath, check_should_pass):
168168 command_post [0 ]["state" ] = "2WAY"
169169 command_post = command_post [:1 ]
170170
171- check = CheckType .init ("exact_match" )
171+ check = CheckType .create ("exact_match" )
172172 pre_value = CheckType .get_value (command_pre , jpath )
173173 post_value = CheckType .get_value (command_post , jpath )
174174 eval_results , passed = check .evaluate (post_value , pre_value )
@@ -199,6 +199,6 @@ def test_lldp_neighbor_state(platform, command, check_should_pass):
199199 if check_should_pass is False :
200200 command_post = command_post [:2 ]
201201
202- check = CheckType .init ("exact_match" )
202+ check = CheckType .create ("exact_match" )
203203 eval_results , passed = check .evaluate (command_post , command_pre )
204204 assert passed is check_should_pass , f"FAILED, eval_result: { eval_results } "
0 commit comments