mirror of https://github.com/docker/cli.git
Merge pull request #4104 from thaJeztah/volume_tests_discard
cli/command/volume: suppress err output in tests
This commit is contained in:
commit
ac38a77ff9
|
@ -50,6 +50,7 @@ func TestVolumeCreateErrors(t *testing.T) {
|
|||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(io.Discard)
|
||||
cmd.SetErr(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ func TestVolumeInspectErrors(t *testing.T) {
|
|||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(io.Discard)
|
||||
cmd.SetErr(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ func TestVolumeListErrors(t *testing.T) {
|
|||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(io.Discard)
|
||||
cmd.SetErr(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ func TestVolumePruneErrors(t *testing.T) {
|
|||
cmd.Flags().Set(key, value)
|
||||
}
|
||||
cmd.SetOut(io.Discard)
|
||||
cmd.SetErr(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ func TestVolumeRemoveErrors(t *testing.T) {
|
|||
}))
|
||||
cmd.SetArgs(tc.args)
|
||||
cmd.SetOut(io.Discard)
|
||||
cmd.SetErr(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue