(t *testing.T)
| 693 | } |
| 694 | |
| 695 | func TestProcessExec(t *testing.T) { |
| 696 | app := "app1" |
| 697 | id := "id1" |
| 698 | s := stdapi.New("api", "api") |
| 699 | s.Route("SOCKET", fmt.Sprintf("/apps/%s/processes/%s/exec", app, id), func(c *stdapi.Context) error { |
| 700 | require.Equal(t, "true", c.Header("Entrypoint")) |
| 701 | require.Equal(t, "1", c.Header("Height")) |
| 702 | require.Equal(t, "2", c.Header("Width")) |
| 703 | return c.Websocket().WriteMessage(websocket.TextMessage, []byte("data"+statusCodePrefix+"0")) |
| 704 | }) |
| 705 | |
| 706 | testServer(t, s, func(c *sdk.Client) { |
| 707 | rw := bufio.NewReadWriter(bufio.NewReader(bytes.NewReader([]byte{})), bufio.NewWriter(&bytes.Buffer{})) |
| 708 | got, err := c.ProcessExec(app, id, "cmd", rw, structs.ProcessExecOptions{ |
| 709 | Entrypoint: options.Bool(true), |
| 710 | Height: options.Int(1), |
| 711 | Width: options.Int(2), |
| 712 | }) |
| 713 | require.NoError(t, err) |
| 714 | require.Equal(t, 0, got) |
| 715 | }) |
| 716 | } |
| 717 | |
| 718 | func TestProcessGet(t *testing.T) { |
| 719 | app := "app1" |
nothing calls this directly
no test coverage detected