mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-23 21:28:15 -05:00
30 lines
561 B
Go
30 lines
561 B
Go
|
package dnsproviders
|
||
|
|
||
|
import (
|
||
|
"npm/internal/util"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestAdProvider(t *testing.T) {
|
||
|
provider := getDNSAd()
|
||
|
provider.ConvertToUpdatable()
|
||
|
json, err := provider.GetJsonSchema()
|
||
|
assert.Nil(t, err)
|
||
|
assert.Equal(t, `{
|
||
|
"title": "dns_ad",
|
||
|
"type": "object",
|
||
|
"additionalProperties": false,
|
||
|
"minProperties": 1,
|
||
|
"properties": {
|
||
|
"AD_API_KEY": {
|
||
|
"title": "api-key",
|
||
|
"type": "string",
|
||
|
"additionalProperties": false,
|
||
|
"minLength": 1
|
||
|
}
|
||
|
}
|
||
|
}`, util.PrettyPrintJSON(json))
|
||
|
}
|