@@ -16,7 +16,7 @@ def test_modelstore_errors(env):
1616 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
1717 return
1818
19- con = env . getConnection ( )
19+ con = get_connection ( env , '{1}' )
2020 model_pb = load_file_content ('pt-minimal.pt' )
2121
2222 # Check that the basic arguments are valid (model's key, device, backend, blob)
@@ -59,7 +59,7 @@ def test_modelget_errors(env):
5959 env .debugPrint ("Skipping test since TF is not available" , force = True )
6060 return
6161
62- con = env . getConnection ( )
62+ con = get_connection ( env , '{1}' )
6363 # ERR WRONGTYPE
6464 con .execute_command ('SET' , 'NOT_MODEL{1}' , 'BAR' )
6565 check_error_message (env , con , "WRONGTYPE Operation against a key holding the wrong kind of value" ,
@@ -77,7 +77,7 @@ def test_modelexecute_errors(env):
7777 if not TEST_TF :
7878 env .debugPrint ("Skipping test since TF is not available" , force = True )
7979 return
80- con = env . getConnection ( )
80+ con = get_connection ( env , '{1}' )
8181
8282 model_pb = load_file_content ('graph.pb' )
8383 ret = con .execute_command ('AI.MODELSTORE' , 'm{1}' , 'TF' , DEVICE ,
@@ -125,7 +125,7 @@ def test_modelexecute_errors(env):
125125 'AI.MODELEXECUTE' , 'm{1}' , 'INPUTS' , 2 , 'a{1}' , 'b{1}' , 'OUTPUTS' , 1 , 'c{1}' , 'TIMEOUT' , 1000 , 'bad_arg' )
126126
127127 con .execute_command ('AI.TENSORSET' , 'a{1}' , 'FLOAT' , 2 , 2 , 'VALUES' , 2 , 3 , 2 , 3 )
128- con .execute_command ('AI.TENSORSET' , 'b' , 'FLOAT' , 2 , 2 , 'VALUES' , 2 , 3 , 2 , 3 )
128+ con .execute_command ('AI.TENSORSET' , 'b{1} ' , 'FLOAT' , 2 , 2 , 'VALUES' , 2 , 3 , 2 , 3 )
129129
130130 # The following 2 commands should raise an error on cluster mode (keys are not on the same shard)
131131 if env .isCluster ():
@@ -141,7 +141,7 @@ def test_keys_syntax(env):
141141 return
142142 # the KEYS keyword must appears in every AI.SCRIPTEXECUTE command, an may appear in AI.DAGEXECUTE(_RO) command.
143143
144- con = env . getConnection ( )
144+ con = get_connection ( env , '{1}' )
145145 script = load_file_content ('script.txt' )
146146 ret = con .execute_command ('AI.SCRIPTSTORE' , 'script{1}' , DEVICE , 'ENTRY_POINTS' , 2 , 'bar' , 'bar_variadic' , 'SOURCE' , script )
147147 env .assertEqual (ret , b'OK' )
@@ -171,7 +171,7 @@ def test_scriptstore(env):
171171 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
172172 return
173173
174- con = env . getConnection ( )
174+ con = get_connection ( env , '{1}' )
175175 script = load_file_content ('script.txt' )
176176
177177 ret = con .execute_command ('AI.SCRIPTSTORE' , 'ket{1}' , DEVICE , 'ENTRY_POINTS' , 2 , 'bar' , 'bar_variadic' , 'SOURCE' , script )
@@ -189,18 +189,18 @@ def test_scriptstore_errors(env):
189189 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
190190 return
191191
192- con = env . getConnection ( )
192+ con = get_connection ( env , '{1}' )
193193 script = load_file_content ('script.txt' )
194194 old_script = load_file_content ('old_script.txt' )
195195 bad_script = load_file_content ('script_bad.txt' )
196196
197197 check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'ket{1}' , DEVICE , 'SOURCE' , 'return 1' )
198198
199- check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'nope' )
199+ check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'nope{1} ' )
200200
201- check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'nope' , 'SOURCE' )
201+ check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'nope{1} ' , 'SOURCE' )
202202
203- check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'more' , DEVICE )
203+ check_error_message (env , con , "wrong number of arguments for 'AI.SCRIPTSTORE' command" , 'AI.SCRIPTSTORE' , 'more{1} ' , DEVICE )
204204
205205 check_error_message (env , con , "Insufficient arguments, missing script entry points" , 'AI.SCRIPTSTORE' , 'ket{1}' , DEVICE , 'NO_ENTRY_POINTS' , 2 , 'bar' , 'bar_variadic' , 'SOURCE' , script )
206206
@@ -222,7 +222,7 @@ def test_pytrorch_scriptget_errors(env):
222222 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
223223 return
224224
225- con = env . getConnection ( )
225+ con = get_connection ( env , '{1}' )
226226
227227 script = load_file_content ('script.txt' )
228228
@@ -249,7 +249,7 @@ def test_pytorch_scriptexecute_errors(env):
249249 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
250250 return
251251
252- con = env . getConnection ( )
252+ con = get_connection ( env , '{1}' )
253253
254254 script = load_file_content ('script.txt' )
255255
@@ -307,7 +307,7 @@ def test_pytorch_scriptexecute_variadic_errors(env):
307307 env .debugPrint ("skipping {} since TEST_PT=0" .format (sys ._getframe ().f_code .co_name ), force = True )
308308 return
309309
310- con = env . getConnection ( )
310+ con = get_connection ( env , '{1}' )
311311
312312 script = load_file_content ('script.txt' )
313313
0 commit comments