optz.
This commit is contained in:
26
all/internal/config/config_test.go
Normal file
26
all/internal/config/config_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"go.yaml.in/yaml/v3"
|
||||
)
|
||||
|
||||
func TestAllDevConfig(t *testing.T) {
|
||||
data, err := os.ReadFile(filepath.Join("..", "..", "etc", "all_dev.yaml"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var cfg SrvConfig
|
||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(cfg.Services) == 0 {
|
||||
t.Fatal("services must not be empty")
|
||||
}
|
||||
if cfg.Fts == nil || cfg.Mgt == nil || cfg.Passport == nil || cfg.Sender == nil || cfg.Wallet == nil {
|
||||
t.Fatal("service-specific configuration is incomplete")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user