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

Function TestBuildUpdate

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

Source from the content-addressed store, hash-verified

351}
352
353func TestBuildUpdate(t *testing.T) {
354 b := &structs.Build{
355 App: "app1",
356 Description: "d1",
357 Entrypoint: "start.sh",
358 Logs: "logs",
359 Manifest: "convox.yml",
360 Process: "ps1",
361 Release: "r1234",
362 Status: "pending",
363 }
364
365 s := stdapi.New("api", "api")
366 s.Route("PUT", fmt.Sprintf("/apps/%s/builds/%s", b.App, "id1"), func(c *stdapi.Context) error {
367 require.Equal(t, b.Entrypoint, c.Form("entrypoint"))
368 require.Equal(t, b.Logs, c.Form("logs"))
369 require.Equal(t, b.Release, c.Form("release"))
370 return c.RenderJSON(b)
371 })
372
373 testServer(t, s, func(c *sdk.Client) {
374 got, err := c.BuildUpdate(b.App, "id1", structs.BuildUpdateOptions{
375 Entrypoint: options.String(b.Entrypoint),
376 Logs: options.String(b.Logs),
377 Release: options.String(b.Release),
378 })
379 require.NoError(t, err)
380 require.Equal(t, b, got)
381 })
382}
383
384func TestCapacityGet(t *testing.T) {
385 cp := &structs.Capacity{

Callers

nothing calls this directly

Calls 3

StringFunction · 0.92
testServerFunction · 0.70
BuildUpdateMethod · 0.65

Tested by

no test coverage detected