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

Function TestSystemResourceGet

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

Source from the content-addressed store, hash-verified

1335}
1336
1337func TestSystemResourceGet(t *testing.T) {
1338 name := "rs1"
1339 rs := &structs.Resource{
1340 Name: name,
1341 Parameters: map[string]string{"hello": "world"},
1342 Status: "status,omitempty",
1343 Type: "type",
1344 Url: "url",
1345 Apps: structs.Apps{{Name: "app1"}},
1346 }
1347 s := stdapi.New("api", "api")
1348 s.Route("GET", fmt.Sprintf("/resources/%s", name), func(c *stdapi.Context) error {
1349 return c.RenderJSON(rs)
1350 })
1351
1352 testServer(t, s, func(c *sdk.Client) {
1353 got, err := c.SystemResourceGet(name)
1354 require.NoError(t, err)
1355 require.Equal(t, rs, got)
1356 })
1357}
1358
1359func TestSystemResourceLink(t *testing.T) {
1360 name := "rs1"

Callers

nothing calls this directly

Calls 2

testServerFunction · 0.70
SystemResourceGetMethod · 0.65

Tested by

no test coverage detected