(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func 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 | |
| 148 | func TestCDNsCreateCustomDomain_NoCertIDFail(t *testing.T) { |
| 149 | withTestClient(t, func(config *CmdConfig, tm *tcMocks) { |
nothing calls this directly
no test coverage detected