MCPcopy Create free account
hub / github.com/QuantumNous/new-api / postTaskPluginStatus

Function postTaskPluginStatus

controller/task_plugin_test.go:135–148  ·  view source on GitHub ↗
(t *testing.T, key, query, body string)

Source from the content-addressed store, hash-verified

133}
134
135func postTaskPluginStatus(t *testing.T, key, query, body string) *httptest.ResponseRecorder {
136 t.Helper()
137 recorder := httptest.NewRecorder()
138 context, _ := gin.CreateTestContext(recorder)
139 context.Params = gin.Params{{Key: "key", Value: key}}
140 path := "/api/plugin/task/" + key + "/status"
141 if query != "" {
142 path += "?" + query
143 }
144 context.Request = httptest.NewRequest(http.MethodPost, path, strings.NewReader(body))
145 context.Request.Header.Set("Content-Type", "application/json")
146 SetTaskPluginStatus(context)
147 return recorder
148}
149
150func listTaskPluginItem(t *testing.T, key string) taskPluginListItem {
151 t.Helper()

Calls 3

SetTaskPluginStatusFunction · 0.85
SetMethod · 0.80
NewReaderMethod · 0.65

Tested by

no test coverage detected