testing: replace legacy gopkg.in/check.v1

This commit replaces the legacy `gopkg.in/check.v1` testing dependency
with `github.com/stretchr/testify`.

Closes https://github.com/distribution/distribution/issues/3884.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-12-08 02:00:27 +08:00 committed by Milos Gajdos
parent bdf70a1e46
commit bcbf0431d1
No known key found for this signature in database
92 changed files with 24688 additions and 4322 deletions

View file

@ -4,20 +4,14 @@ import (
"context"
"os"
"testing"
"gopkg.in/check.v1"
)
func Test(t *testing.T) { check.TestingT(t) }
type MiddlewareSuite struct{}
var _ = check.Suite(&MiddlewareSuite{})
func (s *MiddlewareSuite) TestNoConfig(c *check.C) {
func TestNoConfig(t *testing.T) {
options := make(map[string]interface{})
_, err := newCloudFrontStorageMiddleware(context.Background(), nil, options)
c.Assert(err, check.ErrorMatches, "no baseurl provided")
if err == nil || err.Error() != "no baseurl provided" {
t.Fatalf(`expected error "no baseurl provided", got: %v`, err)
}
}
func TestCloudFrontStorageMiddlewareGenerateKey(t *testing.T) {