|
@@ -20,11 +20,8 @@ func TestContainerStatPathError(t *testing.T) {
|
|
|
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
|
|
}
|
|
|
_, err := client.ContainerStatPath(context.Background(), "container_id", "path")
|
|
|
- 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)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -103,11 +100,8 @@ func TestCopyToContainerError(t *testing.T) {
|
|
|
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
|
|
}
|
|
|
err := client.CopyToContainer(context.Background(), "container_id", "path/to/file", bytes.NewReader([]byte("")), types.CopyToContainerOptions{})
|
|
|
- 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)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -183,11 +177,8 @@ func TestCopyFromContainerError(t *testing.T) {
|
|
|
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
|
|
}
|
|
|
_, _, err := client.CopyFromContainer(context.Background(), "container_id", "path/to/file")
|
|
|
- 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)
|
|
|
}
|
|
|
}
|
|
|
|