(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestBuildCreateNoCache(t *testing.T) { |
| 55 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
| 56 | b1 := fxBuild |
| 57 | var b2 structs.Build |
| 58 | opts := structs.BuildCreateOptions{ |
| 59 | Description: options.String("description"), |
| 60 | Manifest: options.String("manifest"), |
| 61 | NoCache: options.Bool(true), |
| 62 | } |
| 63 | ro := stdsdk.RequestOptions{ |
| 64 | Params: stdsdk.Params{ |
| 65 | "description": "description", |
| 66 | "manifest": "manifest", |
| 67 | "no-cache": "true", |
| 68 | "url": "https://host/path", |
| 69 | }, |
| 70 | } |
| 71 | p.On("BuildCreate", "app1", "https://host/path", opts).Return(&b1, nil) |
| 72 | err := c.Post("/apps/app1/builds", ro, &b2) |
| 73 | require.NoError(t, err) |
| 74 | require.Equal(t, b1, b2) |
| 75 | }) |
| 76 | } |
| 77 | |
| 78 | func TestBuildCreateError(t *testing.T) { |
| 79 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
nothing calls this directly
no test coverage detected