This commit is contained in:
vet
2026-05-28 00:16:19 +08:00
commit 52446ccf3f
54 changed files with 4617 additions and 0 deletions

21
pkg/config/config_test.go Normal file
View File

@@ -0,0 +1,21 @@
package config
import "testing"
func TestMongoURI(t *testing.T) {
cfg := Config{
MongoHost: "127.0.0.1",
MongoPort: 27017,
MongoUsername: "user",
MongoPassword: "pass",
MongoAuthSource: "admin",
BusinessMongoDatabase: "openim_v3",
SchedulerMongoDatabase: "scheduler_center",
}
got := cfg.MongoURI()
want := "mongodb://user:pass@127.0.0.1:27017/?authSource=admin"
if got != want {
t.Fatalf("MongoURI() = %q, want %q", got, want)
}
}