2017-05-16 18:26:07 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Test configuration loading and parsing
|
|
|
|
// using the default config
|
|
|
|
|
|
|
|
func TestLoadConfigs(t *testing.T) {
|
|
|
|
|
2018-07-05 14:41:37 +02:00
|
|
|
config, err := loadConfig("../etc/alicelg/alice.example.conf")
|
2017-05-17 16:11:52 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Error("Could not load test config:", err)
|
|
|
|
}
|
|
|
|
|
2017-05-22 11:13:36 +02:00
|
|
|
if config.Server.Listen == "" {
|
|
|
|
t.Error("Listen string not present.")
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(config.Ui.RoutesColumns) == 0 {
|
|
|
|
t.Error("Route columns settings missing")
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(config.Ui.RoutesRejections.Reasons) == 0 {
|
|
|
|
t.Error("Rejection reasons missing")
|
|
|
|
}
|
2017-05-16 18:26:07 +02:00
|
|
|
}
|