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

Function postTaskPluginStatus

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

Source from the content-addressed store, hash-verified

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

Calls 3

SetTaskPluginStatusFunction · 0.85
SetMethod · 0.80
NewReaderMethod · 0.65

Tested by

no test coverage detected