feat(skills): 场景预设 - 提供公开只读目录并校验内置技能引用 (#603)
This commit is contained in:
@@ -22,6 +22,7 @@ func TestRegisterCanvasAPIExposesOpenAPIAndProjects(t *testing.T) {
|
||||
"POST /api/tasks": false,
|
||||
"POST /api/tasks/:id/recover-media": false,
|
||||
"GET /api/resources": false,
|
||||
"GET /api/skills/presets": false,
|
||||
}
|
||||
for _, route := range router.Routes() {
|
||||
key := route.Method + " " + route.Path
|
||||
@@ -40,4 +41,10 @@ func TestRegisterCanvasAPIExposesOpenAPIAndProjects(t *testing.T) {
|
||||
if recorder.Code != http.StatusOK || !strings.Contains(recorder.Body.String(), "openapi: 3.0.3") || !strings.Contains(recorder.Body.String(), "url: /api") {
|
||||
t.Fatalf("openapi.yaml status=%d body=%s", recorder.Code, recorder.Body.String())
|
||||
}
|
||||
|
||||
recorder = httptest.NewRecorder()
|
||||
router.ServeHTTP(recorder, httptest.NewRequest(http.MethodGet, "/api/skills/presets", nil))
|
||||
if recorder.Code != http.StatusOK || !strings.Contains(recorder.Body.String(), `"presets"`) {
|
||||
t.Fatalf("skills presets status=%d body=%s", recorder.Code, recorder.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user