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

Function TestScaleUpdateError

pkg/cli/scale_test.go:76–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestScaleUpdateError(t *testing.T) {
77 testClient(t, func(e *cli.Engine, i *mocksdk.Interface) {
78 i.On("SystemGet").Return(fxSystem(), nil)
79 i.On("ServiceUpdate", "app1", "web", structs.ServiceUpdateOptions{Count: options.Int(3), Cpu: options.Int(5), Memory: options.Int(10)}).Return(fmt.Errorf("err1"))
80
81 res, err := testExecute(e, "scale web --cpu 5 --memory 10 --count 3 -a app1", nil)
82 require.NoError(t, err)
83 require.Equal(t, 1, res.Code)
84 res.RequireStderr(t, []string{"ERROR: err1"})
85 res.RequireStdout(t, []string{"Scaling web... "})
86 })
87}
88
89func TestScaleUpdateClassic(t *testing.T) {
90 testClient(t, func(e *cli.Engine, i *mocksdk.Interface) {

Callers

nothing calls this directly

Calls 6

IntFunction · 0.92
testClientFunction · 0.85
fxSystemFunction · 0.85
testExecuteFunction · 0.85
RequireStderrMethod · 0.80
RequireStdoutMethod · 0.80

Tested by

no test coverage detected