(key, version, routePath string)
| 1448 | } |
| 1449 | |
| 1450 | func taskPluginControllerRouteSource(key, version, routePath string) string { |
| 1451 | return fmt.Sprintf(` |
| 1452 | export const meta = {apiVersion: 1, key: %q, name: "Test", version: %q, author: {name: "Test"}, models: ["doc-1"], fetchMode: "per_task", |
| 1453 | routes: [{method: "POST", path: %q, type: "submit", decode: "createJob", render: "jobCreated"}]}; |
| 1454 | export const native = { |
| 1455 | createJob(ctx) { return {kind: "submit", model: ctx.body.value.model, requestBody: ctx.body.value}; }, |
| 1456 | jobCreated(ctx, task) { return {id: task.task_id}; }, |
| 1457 | }; |
| 1458 | export function buildSubmitRequest() { return {}; } |
| 1459 | export function parseSubmitResponse() { return {}; } |
| 1460 | export function buildQueryRequest() { return {}; } |
| 1461 | export function parseTaskResult() { return {}; } |
| 1462 | `, key, version, routePath) |
| 1463 | } |
| 1464 | |
| 1465 | func postTaskPluginUpload(t *testing.T, payload map[string]any) *httptest.ResponseRecorder { |
| 1466 | t.Helper() |
no outgoing calls
no test coverage detected