MCPcopy Index your code
hub / github.com/moby/moby / TestExecCreateConnectionError

Function TestExecCreateConnectionError

client/container_exec_test.go:38–44  ·  view source on GitHub ↗

TestExecCreateConnectionError 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)

Source from the content-addressed store, hash-verified

36//
37// Regression test for https://github.com/docker/cli/issues/4890
38func TestExecCreateConnectionError(t *testing.T) {
39 client, err := New(WithHost("tcp://no-such-host.invalid"))
40 assert.NilError(t, err)
41
42 _, err = client.ExecCreate(t.Context(), "container_id", ExecCreateOptions{})
43 assert.Check(t, is.ErrorType(err, IsErrConnectionFailed))
44}
45
46func TestExecCreate(t *testing.T) {
47 const expectedURL = "/containers/container_id/exec"

Callers

nothing calls this directly

Calls 5

WithHostFunction · 0.85
CheckMethod · 0.80
NewFunction · 0.70
ExecCreateMethod · 0.65
ContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…