MCPcopy Create free account
hub / github.com/convox/rack / TestProcessExec

Function TestProcessExec

sdk/methods_test.go:695–716  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

693}
694
695func 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
718func TestProcessGet(t *testing.T) {
719 app := "app1"

Callers

nothing calls this directly

Calls 5

BoolFunction · 0.92
IntFunction · 0.92
WebsocketMethod · 0.80
testServerFunction · 0.70
ProcessExecMethod · 0.65

Tested by

no test coverage detected