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

Function TestCDNsUpdateCustomDomain

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

Source from the content-addressed store, hash-verified

199}
200
201func TestCDNsUpdateCustomDomain(t *testing.T) {
202 withTestClient(t, func(config *CmdConfig, tm *tcMocks) {
203 cdnur := &godo.CDNUpdateCustomDomainRequest{
204 CustomDomain: updatedCDNWithCustomDomain.CustomDomain,
205 CertificateID: updatedCDNWithCustomDomain.CertificateID,
206 }
207 tm.cdns.EXPECT().UpdateCustomDomain(cdnID, cdnur).Return(&updatedCDNWithCustomDomain, nil)
208
209 config.Args = append(config.Args, cdnID)
210 config.Doit.Set(config.NS, doctl.ArgCDNDomain, updatedCDNWithCustomDomain.CustomDomain)
211 config.Doit.Set(config.NS, doctl.ArgCDNCertificateID, updatedCDNWithCustomDomain.CertificateID)
212
213 err := RunCDNUpdate(config)
214 assert.NoError(t, err)
215 })
216}
217
218func TestCDNsUpdateCustomDomain_NoCertIDFail(t *testing.T) {
219 withTestClient(t, func(config *CmdConfig, tm *tcMocks) {

Callers

nothing calls this directly

Calls 5

withTestClientFunction · 0.85
RunCDNUpdateFunction · 0.85
UpdateCustomDomainMethod · 0.65
SetMethod · 0.65
EXPECTMethod · 0.45

Tested by

no test coverage detected