@@ -25,7 +25,7 @@ def __init__(self):
2525 script = f .read ()
2626
2727 ret = self .con .execute_command (
28- 'AI.SCRIPTSET' , 'redis_scripts' , DEVICE , 'SOURCE' , script )
28+ 'AI.SCRIPTSET' , 'redis_scripts{1} ' , DEVICE , 'SOURCE' , script )
2929 self .env .assertEqual (ret , b'OK' )
3030 # self.env.ensureSlaveSynced(self.con, self.env)
3131
@@ -39,22 +39,22 @@ def test_redis_error(self):
3939
4040 def test_simple_test_set (self ):
4141 self .con .execute_command (
42- 'AI.SCRIPTRUN' , 'redis_scripts' , 'test_set_key' )
43- self .env .assertEqual (b"1" , self .con .get ("x" ))
42+ 'AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_set_key' )
43+ self .env .assertEqual (b"1" , self .con .get ("x{1} " ))
4444
4545 def test_int_set_get (self ):
46- self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts' , 'test_int_set_get' , 'OUTPUTS' , 'y' )
47- y = self .con .execute_command ('AI.TENSORGET' , 'y' , 'meta' ,'VALUES' )
46+ self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_int_set_get' , 'OUTPUTS' , 'y{1} ' )
47+ y = self .con .execute_command ('AI.TENSORGET' , 'y{1} ' , 'meta' ,'VALUES' )
4848 self .env .assertEqual (y , [b"dtype" , b"INT64" , b"shape" , [], b"values" , [1 ]] )
4949
5050 def test_int_set_incr (self ):
51- self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts' , 'test_int_set_incr' , 'OUTPUTS' , 'y' )
52- y = self .con .execute_command ('AI.TENSORGET' , 'y' , 'meta' ,'VALUES' )
51+ self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_int_set_incr' , 'OUTPUTS' , 'y{1} ' )
52+ y = self .con .execute_command ('AI.TENSORGET' , 'y{1} ' , 'meta' ,'VALUES' )
5353 self .env .assertEqual (y , [b"dtype" , b"INT64" , b"shape" , [], b"values" , [2 ]] )
5454
5555 def test_float_get_set (self ):
56- self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts' , 'test_float_set_get' , 'OUTPUTS' , 'y' )
57- y = self .con .execute_command ('AI.TENSORGET' , 'y' , 'meta' ,'VALUES' )
56+ self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_float_set_get' , 'OUTPUTS' , 'y{1} ' )
57+ y = self .con .execute_command ('AI.TENSORGET' , 'y{1} ' , 'meta' ,'VALUES' )
5858 self .env .assertEqual (y [0 ], b"dtype" )
5959 self .env .assertEqual (y [1 ], b"FLOAT" )
6060 self .env .assertEqual (y [2 ], b"shape" )
@@ -63,11 +63,11 @@ def test_float_get_set(self):
6363 self .env .assertAlmostEqual (float (y [5 ][0 ]), 1.1 , 0.1 )
6464
6565 def test_int_list (self ):
66- self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts' , 'test_int_list' , 'OUTPUTS' , 'y' )
67- y = self .con .execute_command ('AI.TENSORGET' , 'y' , 'meta' ,'VALUES' )
66+ self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_int_list' , 'OUTPUTS' , 'y{1} ' )
67+ y = self .con .execute_command ('AI.TENSORGET' , 'y{1} ' , 'meta' ,'VALUES' )
6868 self .env .assertEqual (y , [b"dtype" , b"INT64" , b"shape" , [2 , 1 ], b"values" , [1 , 2 ]] )
6969
7070 def test_hash (self ):
71- self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts' , 'test_hash' , 'OUTPUTS' , 'y' )
72- y = self .con .execute_command ('AI.TENSORGET' , 'y' , 'meta' ,'VALUES' )
71+ self .con .execute_command ('AI.SCRIPTRUN' , 'redis_scripts{1} ' , 'test_hash' , 'OUTPUTS' , 'y{1} ' )
72+ y = self .con .execute_command ('AI.TENSORGET' , 'y{1} ' , 'meta' ,'VALUES' )
7373 self .env .assertEqual (y , [b"dtype" , b"INT64" , b"shape" , [2 , 1 ], b"values" , [1 , 2 ]] )
0 commit comments