mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: fix some missing error checks in tests (ineffassign)
client/client_test.go:367:5: ineffectual assignment to err (ineffassign)
_, err = client.Ping(t.Context(), PingOptions{
^
client/client_test.go:381:5: ineffectual assignment to err (ineffassign)
_, err = client.Ping(t.Context(), PingOptions{
^
client/client_test.go:425:5: ineffectual assignment to err (ineffassign)
_, err = client.Ping(t.Context(), PingOptions{
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -367,6 +367,7 @@ func TestNegotiateAPIVersionOverride(t *testing.T) {
|
||||
_, err = client.Ping(t.Context(), PingOptions{
|
||||
NegotiateAPIVersion: true,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(client.ClientVersion(), expected))
|
||||
}
|
||||
|
||||
@@ -381,6 +382,8 @@ func TestNegotiateAPIVersionConnectionFailure(t *testing.T) {
|
||||
_, err = client.Ping(t.Context(), PingOptions{
|
||||
NegotiateAPIVersion: true,
|
||||
})
|
||||
assert.Check(t, is.ErrorType(err, IsErrConnectionFailed))
|
||||
assert.Check(t, is.ErrorContains(err, `failed to connect to the docker API at tcp://no-such-host.invalid`))
|
||||
assert.Check(t, is.Equal(client.ClientVersion(), expected))
|
||||
}
|
||||
|
||||
@@ -425,6 +428,7 @@ func TestNegotiateAPIVersionWithEmptyVersion(t *testing.T) {
|
||||
_, err = client.Ping(t.Context(), PingOptions{
|
||||
NegotiateAPIVersion: true,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(client.ClientVersion(), expected))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user