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

Function TestProcessRunError

pkg/api/process_test.go:215–244  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestProcessRunError(t *testing.T) {
216 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
217 a1 := fxApp
218 p.On("AppGet", "app1").Return(&a1, nil)
219 var p1 *structs.Process
220 opts := structs.ProcessRunOptions{
221 Command: options.String("command"),
222 Environment: map[string]string{"k1": "v1", "k2": "v2"},
223 Height: options.Int(1),
224 Memory: options.Int(2),
225 Release: options.String("release"),
226 Width: options.Int(3),
227 }
228 ro := stdsdk.RequestOptions{
229 Body: strings.NewReader("in"),
230 Headers: stdsdk.Headers{
231 "Command": "command",
232 "Environment": "k1=v1&k2=v2",
233 "Height": "1",
234 "Memory": "2",
235 "Release": "release",
236 "Width": "3",
237 },
238 }
239 p.On("ProcessRun", "app1", "service1", opts).Return(nil, fmt.Errorf("err1"))
240 err := c.Post("/apps/app1/services/service1/processes", ro, &p1)
241 require.EqualError(t, err, "err1")
242 require.Nil(t, p1)
243 })
244}
245
246func TestProcessRunValidate(t *testing.T) {
247 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 4

StringFunction · 0.92
IntFunction · 0.92
PostMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected