evcc-io/meter/config_test.go
2020-08-14 19:49:49 +02:00

25 lines
491 B
Go

package meter
import (
"testing"
"github.com/andig/evcc/util/test"
)
func TestMeters(t *testing.T) {
acceptable := []string{
"invalid plugin type: ...",
"mqtt not configured",
"not a SunSpec device",
"connect: no route to host",
"connect: connection refused",
}
for _, tmpl := range test.ConfigTemplates("meter") {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s", tmpl.Name)
t.Error(err)
}
}
}