TestServiceCreateConnectionError verifies that connection errors occurring during API-version negotiation are not shadowed by API-version errors. Regression test for https://github.com/docker/cli/issues/4890
(t *testing.T)
| 29 | // |
| 30 | // Regression test for https://github.com/docker/cli/issues/4890 |
| 31 | func TestServiceCreateConnectionError(t *testing.T) { |
| 32 | client, err := New(WithHost("tcp://no-such-host.invalid")) |
| 33 | assert.NilError(t, err) |
| 34 | |
| 35 | _, err = client.ServiceCreate(t.Context(), ServiceCreateOptions{}) |
| 36 | assert.Check(t, is.ErrorType(err, IsErrConnectionFailed)) |
| 37 | } |
| 38 | |
| 39 | func TestServiceCreate(t *testing.T) { |
| 40 | const expectedURL = "/services/create" |
nothing calls this directly
no test coverage detected
searching dependent graphs…