mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types: replace uses of deprecated types.Volume with volume.Volume
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -10,8 +10,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
volumetypes "github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
@@ -20,7 +19,7 @@ func TestVolumeCreateError(t *testing.T) {
|
||||
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
||||
}
|
||||
|
||||
_, err := client.VolumeCreate(context.Background(), volumetypes.VolumeCreateBody{})
|
||||
_, err := client.VolumeCreate(context.Background(), volume.VolumeCreateBody{})
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
|
||||
}
|
||||
@@ -39,7 +38,7 @@ func TestVolumeCreate(t *testing.T) {
|
||||
return nil, fmt.Errorf("expected POST method, got %s", req.Method)
|
||||
}
|
||||
|
||||
content, err := json.Marshal(types.Volume{
|
||||
content, err := json.Marshal(volume.Volume{
|
||||
Name: "volume",
|
||||
Driver: "local",
|
||||
Mountpoint: "mountpoint",
|
||||
@@ -54,7 +53,7 @@ func TestVolumeCreate(t *testing.T) {
|
||||
}),
|
||||
}
|
||||
|
||||
volume, err := client.VolumeCreate(context.Background(), volumetypes.VolumeCreateBody{
|
||||
vol, err := client.VolumeCreate(context.Background(), volume.VolumeCreateBody{
|
||||
Name: "myvolume",
|
||||
Driver: "mydriver",
|
||||
DriverOpts: map[string]string{
|
||||
@@ -64,13 +63,13 @@ func TestVolumeCreate(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if volume.Name != "volume" {
|
||||
t.Fatalf("expected volume.Name to be 'volume', got %s", volume.Name)
|
||||
if vol.Name != "volume" {
|
||||
t.Fatalf("expected volume.Name to be 'volume', got %s", vol.Name)
|
||||
}
|
||||
if volume.Driver != "local" {
|
||||
t.Fatalf("expected volume.Driver to be 'local', got %s", volume.Driver)
|
||||
if vol.Driver != "local" {
|
||||
t.Fatalf("expected volume.Driver to be 'local', got %s", vol.Driver)
|
||||
}
|
||||
if volume.Mountpoint != "mountpoint" {
|
||||
t.Fatalf("expected volume.Mountpoint to be 'mountpoint', got %s", volume.Mountpoint)
|
||||
if vol.Mountpoint != "mountpoint" {
|
||||
t.Fatalf("expected volume.Mountpoint to be 'mountpoint', got %s", vol.Mountpoint)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user