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

Function TestObjectFetch

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

Source from the content-addressed store, hash-verified

658}
659
660func TestObjectFetch(t *testing.T) {
661 app := "app1"
662 key := "key1"
663
664 s := stdapi.New("api", "api")
665 s.Route("GET", fmt.Sprintf("/apps/%s/objects/%s", app, key), func(c *stdapi.Context) error {
666 _, err := c.Write([]byte("test"))
667 return err
668 })
669
670 testServer(t, s, func(c *sdk.Client) {
671 got, err := c.ObjectFetch(app, key)
672 require.NoError(t, err)
673 b, _ := io.ReadAll(got)
674 require.Equal(t, "test", string(b))
675 })
676}
677
678func TestObjectList(t *testing.T) {
679 app := "app1"

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.80
testServerFunction · 0.70
ObjectFetchMethod · 0.65

Tested by

no test coverage detected