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

Function TestSystemResourceCreateError

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

Source from the content-addressed store, hash-verified

92}
93
94func TestSystemResourceCreateError(t *testing.T) {
95 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
96 var r1 *structs.Resource
97 ro := stdsdk.RequestOptions{
98 Params: stdsdk.Params{
99 "kind": "type",
100 },
101 }
102 p.On("SystemResourceCreate", "type", structs.ResourceCreateOptions{}).Return(nil, fmt.Errorf("err1"))
103 err := c.Post("/resources", ro, &r1)
104 require.EqualError(t, err, "err1")
105 require.Nil(t, r1)
106 })
107}
108
109func TestSystemResourceDelete(t *testing.T) {
110 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 2

PostMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected