(t *testing.T)
| 351 | } |
| 352 | |
| 353 | func 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 | |
| 384 | func TestCapacityGet(t *testing.T) { |
| 385 | cp := &structs.Capacity{ |
nothing calls this directly
no test coverage detected