nginx-proxy-manager/backend/internal/dnsproviders/dns_ali_test.go

42 lines
856 B
Go
Raw Permalink Normal View History

2023-07-31 05:31:38 +00:00
package dnsproviders
import (
"npm/internal/util"
"testing"
"github.com/stretchr/testify/assert"
2023-11-07 23:57:15 +00:00
"go.uber.org/goleak"
2023-07-31 05:31:38 +00:00
)
func TestAliProvider(t *testing.T) {
2023-11-07 23:57:15 +00:00
// goleak is used to detect goroutine leaks
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
2023-07-31 05:31:38 +00:00
provider := getDNSAli()
json, err := provider.GetJsonSchema()
assert.Nil(t, err)
assert.Equal(t, `{
"title": "dns_ali",
"type": "object",
"additionalProperties": false,
"required": [
"Ali_Key",
"Ali_Secret"
],
"properties": {
"Ali_Key": {
"title": "api-key",
"type": "string",
"additionalProperties": false,
"minLength": 1
},
"Ali_Secret": {
"title": "secret",
"type": "string",
"additionalProperties": false,
"minLength": 1
}
}
}`, util.PrettyPrintJSON(json))
}