From e55bff541e0afc9bacd811b6eb599451a23a9d16 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 7 Feb 2020 15:34:34 +0100 Subject: [PATCH] TestLoginFailsWithBadCredentials: prepare for Go 1.14 changes Go 1.14 adds quotes around the url in the error returned: === FAIL: arm64.integration.system TestLoginFailsWithBadCredentials (0.27s) TestLoginFailsWithBadCredentials: login_test.go:27: assertion failed: expected error "Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password", got "Error response from daemon: Get \"https://registry-1.docker.io/v2/\": unauthorized: incorrect username or password" Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password Signed-off-by: Sebastiaan van Stijn --- integration/system/login_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration/system/login_test.go b/integration/system/login_test.go index 819b7ee7f9..e6506c0811 100644 --- a/integration/system/login_test.go +++ b/integration/system/login_test.go @@ -23,6 +23,7 @@ func TestLoginFailsWithBadCredentials(t *testing.T) { Password: "no-password", } _, err := client.RegistryLogin(context.Background(), config) - expected := "Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password" - assert.Check(t, is.Error(err, expected)) + assert.Assert(t, err != nil) + assert.Check(t, is.ErrorContains(err, "unauthorized: incorrect username or password")) + assert.Check(t, is.ErrorContains(err, "https://registry-1.docker.io/v2/")) }