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

Function postTaskPluginUpload

controller/task_plugin_test.go:1465–1475  ·  view source on GitHub ↗
(t *testing.T, payload map[string]any)

Source from the content-addressed store, hash-verified

1463}
1464
1465func postTaskPluginUpload(t *testing.T, payload map[string]any) *httptest.ResponseRecorder {
1466 t.Helper()
1467 body, err := common.Marshal(payload)
1468 require.NoError(t, err)
1469 recorder := httptest.NewRecorder()
1470 context, _ := gin.CreateTestContext(recorder)
1471 context.Request = httptest.NewRequest(http.MethodPost, "/api/plugin/task", strings.NewReader(string(body)))
1472 context.Request.Header.Set("Content-Type", "application/json")
1473 UploadTaskPlugin(context)
1474 return recorder
1475}
1476
1477func deleteTaskPluginVersionRequest(t *testing.T, key, version string) *httptest.ResponseRecorder {
1478 t.Helper()

Calls 4

MarshalFunction · 0.92
UploadTaskPluginFunction · 0.85
SetMethod · 0.80
NewReaderMethod · 0.65

Tested by

no test coverage detected