MCPcopy
hub / github.com/moby/moby / TestContainerWaitError

Function TestContainerWaitError

client/container_wait_test.go:19–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestContainerWaitError(t *testing.T) {
20 ctx, cancel := context.WithCancel(t.Context())
21 defer cancel()
22
23 client, err := New(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
24 assert.NilError(t, err)
25 wait := client.ContainerWait(ctx, "nothing", ContainerWaitOptions{})
26 select {
27 case result := <-wait.Result:
28 t.Fatalf("expected to not get a wait result, got %d", result.StatusCode)
29 case err := <-wait.Error:
30 assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
31 }
32}
33
34// TestContainerWaitConnectionError verifies that connection errors occurring
35// during API-version negotiation are not shadowed by API-version errors.

Callers

nothing calls this directly

Calls 6

WithMockClientFunction · 0.85
errorMockFunction · 0.85
CheckMethod · 0.80
NewFunction · 0.70
ContextMethod · 0.65
ContainerWaitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…