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

Function TestBuildCreateNoCache

pkg/api/build_test.go:54–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func 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
78func TestBuildCreateError(t *testing.T) {
79 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 4

StringFunction · 0.92
BoolFunction · 0.92
PostMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected