(t *testing.T)
| 963 | } |
| 964 | |
| 965 | func TestDeletePureFactoryPluginIsRejected(t *testing.T) { |
| 966 | setupTaskPluginControllerTest(t) |
| 967 | recorder := httptest.NewRecorder() |
| 968 | context, _ := gin.CreateTestContext(recorder) |
| 969 | context.Params = gin.Params{{Key: "key", Value: "kling"}, {Key: "version", Value: "1.0.0"}} |
| 970 | context.Request = httptest.NewRequest(http.MethodDelete, "/api/plugin/task/kling/versions/1.0.0", nil) |
| 971 | |
| 972 | DeleteTaskPluginVersion(context) |
| 973 | |
| 974 | assert.Contains(t, recorder.Body.String(), `"success":false`) |
| 975 | assert.Contains(t, recorder.Body.String(), "factory plugins cannot be deleted") |
| 976 | _, ok := jsplugin.DefaultRegistry.Get("kling") |
| 977 | assert.True(t, ok) |
| 978 | } |
| 979 | |
| 980 | func TestUploadTaskPluginSourceSha256(t *testing.T) { |
| 981 | setupTaskPluginControllerTest(t) |
nothing calls this directly
no test coverage detected