From dea497d18b263db907ca3b182e5f94a17d632f84 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 7 Dec 2024 17:10:01 +0800 Subject: [PATCH] update Load method args. --- pkg/common/config/load_config_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go index c17caa0f82..ea11b05747 100644 --- a/pkg/common/config/load_config_test.go +++ b/pkg/common/config/load_config_test.go @@ -10,7 +10,7 @@ import ( func TestLoadLogConfig(t *testing.T) { var log Log os.Setenv("IMENV_LOG_REMAINLOGLEVEL", "5") - err := Load("../../../config/", "log.yml", "IMENV_LOG", &log) + err := Load("../../../config/", "log.yml", "IMENV_LOG", "source", &log) assert.Nil(t, err) t.Log(log.RemainLogLevel) // assert.Equal(t, "../../../../logs/", log.StorageLocation) @@ -22,7 +22,7 @@ func TestLoadMongoConfig(t *testing.T) { os.Setenv("IMENV_MONGODB_PASSWORD", "openIM1231231") // os.Setenv("IMENV_MONGODB_URI", "openIM123") // os.Setenv("IMENV_MONGODB_USERNAME", "openIM123") - err := Load("../../../config/", "mongodb.yml", "IMENV_MONGODB", &mongo) + err := Load("../../../config/", "mongodb.yml", "IMENV_MONGODB", "source", &mongo) // err := LoadConfig("../../../config/mongodb.yml", "IMENV_MONGODB", &mongo) assert.Nil(t, err) @@ -38,14 +38,14 @@ func TestLoadMongoConfig(t *testing.T) { func TestLoadMinioConfig(t *testing.T) { var storageConfig Minio - err := Load("../../../config/minio.yml", "IMENV_MINIO", "", &storageConfig) + err := Load("../../../config/minio.yml", "IMENV_MINIO", "", "source", &storageConfig) assert.Nil(t, err) assert.Equal(t, "openim", storageConfig.Bucket) } func TestLoadWebhooksConfig(t *testing.T) { var webhooks Webhooks - err := Load("../../../config/webhooks.yml", "IMENV_WEBHOOKS", "", &webhooks) + err := Load("../../../config/webhooks.yml", "IMENV_WEBHOOKS", "", "source", &webhooks) assert.Nil(t, err) assert.Equal(t, 5, webhooks.BeforeAddBlack.Timeout) @@ -53,7 +53,7 @@ func TestLoadWebhooksConfig(t *testing.T) { func TestLoadOpenIMRpcUserConfig(t *testing.T) { var user User - err := Load("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", "", &user) + err := Load("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", "", "source", &user) assert.Nil(t, err) //export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0" assert.Equal(t, "0.0.0.0", user.RPC.ListenIP) @@ -63,14 +63,14 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) { func TestLoadNotificationConfig(t *testing.T) { var noti Notification - err := Load("../../../config/notification.yml", "IMENV_NOTIFICATION", "", ¬i) + err := Load("../../../config/notification.yml", "IMENV_NOTIFICATION", "", "source", ¬i) assert.Nil(t, err) assert.Equal(t, "Your friend's profile has been changed", noti.FriendRemarkSet.OfflinePush.Title) } func TestLoadOpenIMThirdConfig(t *testing.T) { var third Third - err := Load("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", "", &third) + err := Load("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", "", "source", &third) assert.Nil(t, err) assert.Equal(t, "enabled", third.Object.Enable) assert.Equal(t, "https://oss-cn-chengdu.aliyuncs.com", third.Object.Oss.Endpoint)