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

Function TestSystemResourceUpdate

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

Source from the content-addressed store, hash-verified

1450}
1451
1452func TestSystemResourceUpdate(t *testing.T) {
1453 rs := &structs.Resource{
1454 Name: "name",
1455 Parameters: map[string]string{"hello": "world"},
1456 Status: "status,omitempty",
1457 Type: "type",
1458 Url: "url",
1459 Apps: structs.Apps{{Name: "app1"}},
1460 }
1461 s := stdapi.New("api", "api")
1462 s.Route("PUT", fmt.Sprintf("/resources/%s", rs.Name), func(c *stdapi.Context) error {
1463 require.Equal(t, "hello=world", c.Form("parameters"))
1464 return c.RenderJSON(rs)
1465 })
1466
1467 testServer(t, s, func(c *sdk.Client) {
1468 got, err := c.SystemResourceUpdate(rs.Name, structs.ResourceUpdateOptions{
1469 Parameters: rs.Parameters,
1470 })
1471 require.NoError(t, err)
1472 require.Equal(t, rs, got)
1473 })
1474}
1475
1476func TestSystemUpdate(t *testing.T) {
1477 s := stdapi.New("api", "api")

Callers

nothing calls this directly

Calls 2

testServerFunction · 0.70
SystemResourceUpdateMethod · 0.65

Tested by

no test coverage detected