Browse Source

Fix tests for root not found by fingerprint functionality

Broken test was merged as part of https://github.com/smallstep/certificates/pull/1893.
Herman Slatman 11 tháng trước cách đây
mục cha
commit
979edbb591
2 tập tin đã thay đổi với 2 bổ sung và 2 xóa
  1. 1 1
      api/api_test.go
  2. 1 1
      ca/ca_test.go

+ 1 - 1
api/api_test.go

@@ -860,7 +860,7 @@ func Test_Root(t *testing.T) {
 		statusCode  int
 		statusCode  int
 	}{
 	}{
 		{"ok", parseCertificate(rootPEM), nil, "", 200},
 		{"ok", parseCertificate(rootPEM), nil, "", 200},
-		{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf("root certificate with fingerprint %q was not found", sha), 404},
+		{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf(`root certificate with fingerprint \"%s\" was not found`, sha), 404},
 	}
 	}
 
 
 	// Request with chi context
 	// Request with chi context

+ 1 - 1
ca/ca_test.go

@@ -482,7 +482,7 @@ func TestCARoot(t *testing.T) {
 				ca:     ca,
 				ca:     ca,
 				sha:    "foo",
 				sha:    "foo",
 				status: http.StatusNotFound,
 				status: http.StatusNotFound,
-				errMsg: errs.NotFoundDefaultMsg,
+				errMsg: `root certificate with fingerprint "foo" was not found`,
 			}
 			}
 		},
 		},
 		"success": func(t *testing.T) *rootTest {
 		"success": func(t *testing.T) *rootTest {