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

Function postTaskPluginStatus

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

Source from the content-addressed store, hash-verified

163}
164
165func postTaskPluginStatus(t *testing.T, key, query, body string) *httptest.ResponseRecorder {
166 t.Helper()
167 recorder := httptest.NewRecorder()
168 context, _ := gin.CreateTestContext(recorder)
169 context.Params = gin.Params{{Key: "key", Value: key}}
170 path := "/api/plugin/task/" + key + "/status"
171 if query != "" {
172 path += "?" + query
173 }
174 context.Request = httptest.NewRequest(http.MethodPost, path, strings.NewReader(body))
175 context.Request.Header.Set("Content-Type", "application/json")
176 SetTaskPluginStatus(context)
177 return recorder
178}
179
180func listTaskPluginItem(t *testing.T, key string) taskPluginListItem {
181 t.Helper()

Calls 3

SetTaskPluginStatusFunction · 0.85
SetMethod · 0.80
NewReaderMethod · 0.65

Tested by

no test coverage detected