Files
Havline/internal/ddns/tencentcloud_test.go
T

27 lines
563 B
Go
Raw Normal View History

2026-09-23 09:40:59 +08:00
package ddns
import "testing"
func TestTencentSubdomain(t *testing.T) {
if tencentSubdomain("@") != "@" {
t.Fatal("expected @")
}
if tencentSubdomain("www") != "www" {
t.Fatal("expected www")
}
}
func TestCredentialsTencentCloud(t *testing.T) {
cred := CredentialsFromSave(SaveInput{
Provider: "tencentcloud",
APIToken: "AKIDxxx",
APISecret: "secret",
})
if cred.Provider != "tencentcloud" || !cred.HasValues() {
t.Fatal("expected tencentcloud credentials")
}
if err := cred.Validate("tencentcloud"); err != nil {
t.Fatal(err)
}
}