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

Function TestBuildCreate

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

Source from the content-addressed store, hash-verified

200}
201
202func TestBuildCreate(t *testing.T) {
203 b := &structs.Build{
204 App: "app1",
205 Description: "d1",
206 Entrypoint: "",
207 Logs: "",
208 Manifest: "convox.yml",
209 Process: "ps1",
210 Release: "r1234",
211 Status: "pending",
212 }
213
214 s := stdapi.New("api", "api")
215 s.Route("POST", fmt.Sprintf("/apps/%s/builds", b.App), func(c *stdapi.Context) error {
216 require.Equal(t, "url", c.Form("url"))
217 require.Equal(t, b.Description, c.Form("description"))
218 require.Equal(t, b.Manifest, c.Form("manifest"))
219 require.Equal(t, "true", c.Form("no-cache"))
220 require.Equal(t, "true", c.Form("wildcard-domain"))
221 return c.RenderJSON(b)
222 })
223
224 testServer(t, s, func(c *sdk.Client) {
225 got, err := c.BuildCreate(b.App, "url", structs.BuildCreateOptions{
226 Description: options.String(b.Description),
227 Manifest: options.String(b.Manifest),
228 NoCache: options.Bool(true),
229 WildcardDomain: options.Bool(true),
230 })
231 require.NoError(t, err)
232 require.Equal(t, b, got)
233 })
234}
235
236func TestBuildExport(t *testing.T) {
237 app := "app1"

Callers

nothing calls this directly

Calls 4

StringFunction · 0.92
BoolFunction · 0.92
testServerFunction · 0.70
BuildCreateMethod · 0.65

Tested by

no test coverage detected