(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestInitTtySizeErrors(t *testing.T) { |
| 17 | expectedError := "failed to resize tty, using default size\n" |
| 18 | fakeContainerExecResizeFunc := func(id string, options client.ExecResizeOptions) (client.ExecResizeResult, error) { |
| 19 | return client.ExecResizeResult{}, errors.New("error response from daemon: no such exec") |
| 20 | } |
| 21 | fakeResizeTtyFunc := func(ctx context.Context, cli command.Cli, id string, isExec bool) error { |
| 22 | height, width := uint(1024), uint(768) |
| 23 | return resizeTTYTo(ctx, cli.Client(), id, height, width, isExec) |
| 24 | } |
| 25 | ctx := context.Background() |
| 26 | cli := test.NewFakeCli(&fakeClient{containerExecResizeFunc: fakeContainerExecResizeFunc}) |
| 27 | initTtySize(ctx, cli, "8mm8nn8tt8bb", true, fakeResizeTtyFunc) |
| 28 | time.Sleep(1500 * time.Millisecond) |
| 29 | assert.Check(t, is.Equal(expectedError, cli.ErrBuffer().String())) |
| 30 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…