@@ -9,59 +9,71 @@ func TestNewRedisOnlineStore1(t *testing.T) {
99 onlineStoreConfig := map [string ]interface {}{
1010 "type" : "redis" ,
1111 }
12- r , err := NewRedisOnlineStore (onlineStoreConfig )
12+ r , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
1313 assert .Nil (t , err )
14- assert .Equal (t , []string {"localhost:6379" }, r .addrs )
15- assert .Empty (t , r .password )
16- assert .False (t , r .ssl )
17- assert .Equal (t , redisNode , r .t )
14+ assert .Equal (t , & RedisOnlineStore {
15+ t : redisNode ,
16+ addrs : []string {"localhost:6379" },
17+ password : "" ,
18+ ssl : false ,
19+ project : "feature_repo" ,
20+ }, r )
1821}
1922
2023func TestNewRedisOnlineStore2 (t * testing.T ) {
2124 onlineStoreConfig := map [string ]interface {}{
2225 "type" : "redis" ,
2326 "redis_type" : "redis" ,
2427 }
25- r , err := NewRedisOnlineStore (onlineStoreConfig )
28+ r , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
2629 assert .Nil (t , err )
27- assert .Equal (t , []string {"localhost:6379" }, r .addrs )
28- assert .Empty (t , r .password )
29- assert .False (t , r .ssl )
30- assert .Equal (t , redisNode , r .t )
30+ assert .Equal (t , & RedisOnlineStore {
31+ t : redisNode ,
32+ addrs : []string {"localhost:6379" },
33+ password : "" ,
34+ ssl : false ,
35+ project : "feature_repo" ,
36+ }, r )
3137}
3238
3339func TestNewRedisOnlineStore3 (t * testing.T ) {
3440 onlineStoreConfig := map [string ]interface {}{
3541 "type" : "redis" ,
3642 "redis_type" : "redis_cluster" ,
3743 }
38- r , err := NewRedisOnlineStore (onlineStoreConfig )
44+ r , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
3945 assert .Nil (t , err )
40- assert .Equal (t , []string {"localhost:6379" }, r .addrs )
41- assert .Empty (t , r .password )
42- assert .False (t , r .ssl )
43- assert .Equal (t , redisCluster , r .t )
46+ assert .Equal (t , & RedisOnlineStore {
47+ t : redisCluster ,
48+ addrs : []string {"localhost:6379" },
49+ password : "" ,
50+ ssl : false ,
51+ project : "feature_repo" ,
52+ }, r )
4453}
4554
4655func TestNewRedisOnlineStore4 (t * testing.T ) {
4756 onlineStoreConfig := map [string ]interface {}{
4857 "type" : "redis_cluster" ,
4958 "connection_string" : "localhost:6379,localhost:6380,password=123456,ssl=true" ,
5059 }
51- r , err := NewRedisOnlineStore (onlineStoreConfig )
60+ r , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
5261 assert .Nil (t , err )
53- assert .Equal (t , []string {"localhost:6379" , "localhost:6380" }, r .addrs )
54- assert .Equal (t , "123456" , r .password )
55- assert .True (t , r .ssl )
56- assert .Equal (t , redisNode , r .t )
62+ assert .Equal (t , & RedisOnlineStore {
63+ t : redisNode ,
64+ addrs : []string {"localhost:6379" , "localhost:6380" },
65+ password : "123456" ,
66+ ssl : true ,
67+ project : "feature_repo" ,
68+ }, r )
5769}
5870
5971func TestNewRedisOnlineStore5 (t * testing.T ) {
6072 onlineStoreConfig := map [string ]interface {}{
6173 "type" : "redis_cluster" ,
6274 "connection_string" : "localhost:6379,foo=bar" ,
6375 }
64- _ , err := NewRedisOnlineStore (onlineStoreConfig )
76+ _ , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
6577 assert .NotNil (t , err )
6678}
6779
@@ -70,6 +82,6 @@ func TestNewRedisOnlineStore6(t *testing.T) {
7082 "type" : "redis_cluster" ,
7183 "connection_string" : "localhost:6379,test" ,
7284 }
73- _ , err := NewRedisOnlineStore (onlineStoreConfig )
85+ _ , err := NewRedisOnlineStore ("feature_repo" , onlineStoreConfig )
7486 assert .NotNil (t , err )
7587}
0 commit comments