瀏覽代碼

Fix error string in tests

This commit fixes a test checking an error string from an external
dependency.
Mariano Cano 3 年之前
父節點
當前提交
d8eeebfd51
共有 1 個文件被更改,包括 4 次插入 和 3 次删除
  1. 4 3
      acme/challenge_test.go

+ 4 - 3
acme/challenge_test.go

@@ -3444,7 +3444,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
 					},
 					payload: errorCBORPayload,
 				},
-				wantErr: NewErrorISE("error unmarshalling CBOR: cbor: cannot unmarshal positive integer into Go value of type acme.attestationObject"),
+				wantErr: NewErrorISE("error unmarshalling CBOR: cbor:"),
 			}
 		},
 		"ok/prov.IsAttestationFormatEnabled": func(t *testing.T) test {
@@ -4003,8 +4003,9 @@ func Test_deviceAttest01Validate(t *testing.T) {
 			tc := run(t)
 
 			if err := deviceAttest01Validate(tc.args.ctx, tc.args.ch, tc.args.db, tc.args.jwk, tc.args.payload); err != nil {
-				assert.Error(t, tc.wantErr)
-				assert.EqualError(t, err, tc.wantErr.Error())
+				if assert.Error(t, tc.wantErr) {
+					assert.ErrorContains(t, err, tc.wantErr.Error())
+				}
 				return
 			}