@@ -229,7 +229,7 @@ func TestCertInfo(t *testing.T) {
229229 }
230230}
231231
232- func TestCertDeleteion (t * testing.T ) {
232+ func TestCertDeletion (t * testing.T ) {
233233 t .Parallel ()
234234
235235 handler := fakeHTTPServer {}
@@ -249,6 +249,10 @@ func TestCertDeleteion(t *testing.T) {
249249 if err = Delete (& client , "test-example-com" ); err != nil {
250250 t .Fatal (err )
251251 }
252+
253+ if err := Delete (& client , "non-existent-cert" ); err == nil {
254+ t .Fatal ("An Error should have resulted from the attempt to delete a non-existent-cert" )
255+ }
252256}
253257
254258func TestCertAttach (t * testing.T ) {
@@ -271,6 +275,15 @@ func TestCertAttach(t *testing.T) {
271275 if err = Attach (& client , "test-example-com" , "foo.com" ); err != nil {
272276 t .Fatal (err )
273277 }
278+
279+ if err := Attach (& client , "non-existent-cert" , "foo.com" ); err == nil {
280+ t .Fatal ("An Error should have resulted from the attempt to attach a non-existent cert to a valid domain" )
281+ }
282+
283+ // TODO: #475
284+ // if err := Attach(&client, "test-example-com", "non-existent.domain.com"); err == nil {
285+ // t.Fatal("An Error should have resulted from the attempt to attach a valid cert to a non-existent domain")
286+ // }
274287}
275288
276289func TestCertDetach (t * testing.T ) {
@@ -293,4 +306,12 @@ func TestCertDetach(t *testing.T) {
293306 if err = Detach (& client , "test-example-com" , "foo.com" ); err != nil {
294307 t .Fatal (err )
295308 }
309+
310+ if err := Detach (& client , "non-existent-cert" , "foo.com" ); err == nil {
311+ t .Fatal ("An Error should have resulted from the attempt to detach a non-existent cert from a valid domain" )
312+ }
313+
314+ if err := Detach (& client , "test-example-com" , "non-existent.domain.com" ); err == nil {
315+ t .Fatal ("An Error should have resulted from the attempt to detach a valid cert from a non-existent domain" )
316+ }
296317}
0 commit comments