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

Function TestSystemProcesses

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

Source from the content-addressed store, hash-verified

1239}
1240
1241func TestSystemProcesses(t *testing.T) {
1242 ps := structs.Processes{
1243 {
1244 Id: "id1",
1245 App: "app1",
1246 Command: "command",
1247 Cpu: 5,
1248 Host: "host",
1249 Image: "image",
1250 Instance: "instance",
1251 Memory: 1024,
1252 Name: "name",
1253 Ports: []string{"5000"},
1254 Release: "release",
1255 Status: "status",
1256 TaskDefinition: "task_definition",
1257 },
1258 }
1259
1260 s := stdapi.New("api", "api")
1261 s.Route("GET", fmt.Sprintf("/system/processes"), func(c *stdapi.Context) error {
1262 require.Equal(t, "true", c.Query("all"))
1263 return c.RenderJSON(ps)
1264 })
1265
1266 testServer(t, s, func(c *sdk.Client) {
1267 got, err := c.SystemProcesses(structs.SystemProcessesOptions{
1268 All: options.Bool(true),
1269 })
1270 require.NoError(t, err)
1271 require.Equal(t, ps, got)
1272 })
1273}
1274
1275func TestSystemReleases(t *testing.T) {
1276 rs := structs.Releases{{

Callers

nothing calls this directly

Calls 3

BoolFunction · 0.92
testServerFunction · 0.70
SystemProcessesMethod · 0.65

Tested by

no test coverage detected