summaryrefslogtreecommitdiff
path: root/client/image_build_test.go
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2019-10-13 00:31:53 +0200
committerSebastiaan van Stijn <github@gone.nl>2019-10-13 17:00:40 +0200
commitde10c7d0136dc054abdb40ca624211c04334bdc0 (patch)
tree698c61a6057c402706ad054da750c83fe97f8551 /client/image_build_test.go
parentd1e837d2a8d5f82c750c70b2e360b9f103f0273f (diff)
downloaddocker-de10c7d0136dc054abdb40ca624211c04334bdc0.tar.gz
client: reduce string-matching in tests
These checks were redundant, as we were not expecting a specific string, just that a server-error or authentication error was returned. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'client/image_build_test.go')
-rw-r--r--client/image_build_test.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/client/image_build_test.go b/client/image_build_test.go
index 353bc12eb1..0d4ea85c63 100644
--- a/client/image_build_test.go
+++ b/client/image_build_test.go
@@ -21,11 +21,8 @@ func TestImageBuildError(t *testing.T) {
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
}
_, err := client.ImageBuild(context.Background(), nil, types.ImageBuildOptions{})
- if err == nil || err.Error() != "Error response from daemon: Server error" {
- t.Fatalf("expected a Server Error, got %v", err)
- }
if !errdefs.IsSystem(err) {
- t.Fatalf("expected a Server Error, got %T", err)
+ t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
}
}