MCPcopy
hub / github.com/digitalocean/doctl / TestCDNsCreateCustomDomain

Function TestCDNsCreateCustomDomain

commands/cdns_test.go:128–146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestCDNsCreateCustomDomain(t *testing.T) {
129 withTestClient(t, func(config *CmdConfig, tm *tcMocks) {
130 cdncr := &godo.CDNCreateRequest{
131 Origin: cdnOrigin,
132 TTL: 3600,
133 CustomDomain: testCDNWithCustomDomain.CustomDomain,
134 CertificateID: testCDNWithCustomDomain.CertificateID,
135 }
136 tm.cdns.EXPECT().Create(cdncr).Return(&testCDNWithCustomDomain, nil)
137
138 config.Args = append(config.Args, cdnOrigin)
139 config.Doit.Set(config.NS, doctl.ArgCDNTTL, 3600)
140 config.Doit.Set(config.NS, doctl.ArgCDNDomain, testCDNWithCustomDomain.CustomDomain)
141 config.Doit.Set(config.NS, doctl.ArgCDNCertificateID, testCDNWithCustomDomain.CertificateID)
142
143 err := RunCDNCreate(config)
144 assert.NoError(t, err)
145 })
146}
147
148func TestCDNsCreateCustomDomain_NoCertIDFail(t *testing.T) {
149 withTestClient(t, func(config *CmdConfig, tm *tcMocks) {

Callers

nothing calls this directly

Calls 5

withTestClientFunction · 0.85
RunCDNCreateFunction · 0.85
CreateMethod · 0.65
SetMethod · 0.65
EXPECTMethod · 0.45

Tested by

no test coverage detected