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

Function TestProcessGet

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

Source from the content-addressed store, hash-verified

716}
717
718func TestProcessGet(t *testing.T) {
719 app := "app1"
720 pid := "pid"
721 p := &structs.Process{
722 Id: "id1",
723 App: "app1",
724 Command: "command",
725 Cpu: 5,
726 Host: "host",
727 Image: "image",
728 Instance: "instance",
729 Memory: 1024,
730 Name: "name",
731 Ports: []string{"5000"},
732 Release: "release",
733 Status: "status",
734 TaskDefinition: "task_definition",
735 }
736
737 s := stdapi.New("api", "api")
738 s.Route("GET", fmt.Sprintf("/apps/%s/processes/%s", app, pid), func(c *stdapi.Context) error {
739 return c.RenderJSON(p)
740 })
741
742 testServer(t, s, func(c *sdk.Client) {
743 got, err := c.ProcessGet(app, pid)
744 require.NoError(t, err)
745 require.Equal(t, p, got)
746 })
747}
748
749func TestProcessList(t *testing.T) {
750 app := "app1"

Callers

nothing calls this directly

Calls 2

testServerFunction · 0.70
ProcessGetMethod · 0.65

Tested by

no test coverage detected