1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Automated migration using

gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2018-03-13 15:28:34 -04:00
parent ef01dea893
commit 6be0f70983
183 changed files with 2253 additions and 2199 deletions

View file

@ -8,7 +8,8 @@ import (
"testing"
"github.com/docker/docker/pkg/plugingetter"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"golang.org/x/net/context"
)
@ -30,7 +31,7 @@ func TestMiddlewareWrapHandler(t *testing.T) {
middleWare.SetPlugins([]string{"My Test Plugin"})
setAuthzPlugins(middleWare, authList)
mdHandler := middleWare.WrapHandler(handler)
require.NotNil(t, mdHandler)
assert.Assert(t, mdHandler != nil)
addr := "www.example.com/auth"
req, _ := http.NewRequest("GET", addr, nil)
@ -46,7 +47,7 @@ func TestMiddlewareWrapHandler(t *testing.T) {
Msg: "Server Auth Not Allowed",
}
if err := mdHandler(ctx, resp, req, map[string]string{}); err == nil {
require.Error(t, err)
assert.Assert(t, is.ErrorContains(err, ""))
}
})
@ -57,7 +58,7 @@ func TestMiddlewareWrapHandler(t *testing.T) {
Msg: "Server Auth Allowed",
}
if err := mdHandler(ctx, resp, req, map[string]string{}); err != nil {
require.NoError(t, err)
assert.NilError(t, err)
}
})