mirror of https://github.com/docker/cli.git
cli/command/volume: remove deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b5dce3c9e6
commit
cca73bff41
|
@ -1,7 +1,7 @@
|
|||
package volume
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
@ -49,7 +49,7 @@ func TestVolumeCreateErrors(t *testing.T) {
|
|||
for key, value := range tc.flags {
|
||||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package volume
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/cli/internal/test"
|
||||
|
@ -60,7 +60,7 @@ func TestVolumeInspectErrors(t *testing.T) {
|
|||
for key, value := range tc.flags {
|
||||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package volume
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/cli/cli/config/configfile"
|
||||
|
@ -43,7 +43,7 @@ func TestVolumeListErrors(t *testing.T) {
|
|||
for key, value := range tc.flags {
|
||||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package volume
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
@ -48,7 +48,7 @@ func TestVolumePruneErrors(t *testing.T) {
|
|||
for key, value := range tc.flags {
|
||||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ func TestVolumePrunePromptYes(t *testing.T) {
|
|||
volumePruneFunc: simplePruneFunc,
|
||||
})
|
||||
|
||||
cli.SetIn(streams.NewIn(ioutil.NopCloser(strings.NewReader(input))))
|
||||
cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input))))
|
||||
cmd := NewPruneCommand(cli)
|
||||
assert.NilError(t, cmd.Execute())
|
||||
golden.Assert(t, cli.OutBuffer().String(), "volume-prune-yes.golden")
|
||||
|
@ -102,7 +102,7 @@ func TestVolumePrunePromptNo(t *testing.T) {
|
|||
volumePruneFunc: simplePruneFunc,
|
||||
})
|
||||
|
||||
cli.SetIn(streams.NewIn(ioutil.NopCloser(strings.NewReader(input))))
|
||||
cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input))))
|
||||
cmd := NewPruneCommand(cli)
|
||||
assert.NilError(t, cmd.Execute())
|
||||
golden.Assert(t, cli.OutBuffer().String(), "volume-prune-no.golden")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package volume
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/cli/internal/test"
|
||||
|
@ -32,7 +32,7 @@ func TestVolumeRemoveErrors(t *testing.T) {
|
|||
volumeRemoveFunc: tc.volumeRemoveFunc,
|
||||
}))
|
||||
cmd.SetArgs(tc.args)
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue