mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
@@ -25,7 +26,9 @@ func TestContainersPruneError(t *testing.T) {
|
||||
filters := filters.NewArgs()
|
||||
|
||||
_, err := client.ContainersPrune(context.Background(), filters)
|
||||
assert.Check(t, is.Error(err, "Error response from daemon: Server error"))
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainersPrune(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user