Co-authored-by: andig <cpuidle@gmail.com> Co-authored-by: andig <andi@evcc.io> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Co-authored-by: Michael Geers <michael@geers.tv>
24 lines
518 B
Go
24 lines
518 B
Go
package messenger
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/evcc-io/evcc/util/templates"
|
|
"github.com/evcc-io/evcc/util/test"
|
|
)
|
|
|
|
var acceptable = []string{
|
|
// api.ErrMissingCredentials.Error(),
|
|
// api.ErrMissingToken.Error(),
|
|
}
|
|
|
|
func TestTemplates(t *testing.T) {
|
|
templates.TestClass(t, templates.Messenger, func(t *testing.T, values map[string]any) {
|
|
t.Helper()
|
|
|
|
if _, err := NewFromConfig(t.Context(), "template", values); err != nil && !test.Acceptable(err, acceptable) {
|
|
t.Log(values)
|
|
t.Error(err)
|
|
}
|
|
})
|
|
}
|