init
This commit is contained in:
21
pkg/config/config_test.go
Normal file
21
pkg/config/config_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user