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

Function TestSystemResourceUpdate

pkg/api/resource_test.go:240–257  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

238}
239
240func TestSystemResourceUpdate(t *testing.T) {
241 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
242 r1 := fxResource
243 r2 := structs.Resource{}
244 opts := structs.ResourceUpdateOptions{
245 Parameters: map[string]string{"k1": "v1", "k2": "v2"},
246 }
247 ro := stdsdk.RequestOptions{
248 Params: stdsdk.Params{
249 "parameters": "k1=v1&k2=v2",
250 },
251 }
252 p.On("SystemResourceUpdate", "resource1", opts).Return(&r1, nil)
253 err := c.Put("/resources/resource1", ro, &r2)
254 require.NoError(t, err)
255 require.Equal(t, r1, r2)
256 })
257}
258
259func TestSystemResourceUpdateError(t *testing.T) {
260 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 1

testServerFunction · 0.70

Tested by

no test coverage detected