evcc-io/charger/config_test.go
2020-09-12 17:20:04 +02:00

27 lines
584 B
Go

package charger
import (
"testing"
"github.com/andig/evcc/util/test"
)
func TestChargers(t *testing.T) {
acceptable := []string{
"invalid plugin type: ...",
"mqtt not configured",
"invalid charger type: nrgkick-bluetooth",
"NRGKick bluetooth is only supported on linux",
"invalid pin:",
"connect: no route to host",
"connect: connection refused",
}
for _, tmpl := range test.ConfigTemplates("charger") {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s", tmpl.Name)
t.Error(err)
}
}
}