mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-08-24 18:16:01 -04:00
0b938ce98d
* feat: plugin list query improve * feat: add category-scoped installed plugin ids * feat: plugin model summary * feat: expose verification in model plugin bindings * test: update Redis client initialization
35 lines
810 B
Go
35 lines
810 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestListModelPluginBindingsRequestBindsTenant(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
router := gin.New()
|
|
var received listModelPluginBindingsRequest
|
|
router.GET("/plugin/:tenant_id/management/models/bindings", func(c *gin.Context) {
|
|
BindRequest(c, func(request listModelPluginBindingsRequest) {
|
|
received = request
|
|
c.Status(http.StatusNoContent)
|
|
})
|
|
})
|
|
|
|
request := httptest.NewRequest(
|
|
http.MethodGet,
|
|
"/plugin/tenant-1/management/models/bindings",
|
|
nil,
|
|
)
|
|
response := httptest.NewRecorder()
|
|
|
|
router.ServeHTTP(response, request)
|
|
|
|
require.Equal(t, http.StatusNoContent, response.Code)
|
|
require.Equal(t, "tenant-1", received.TenantID)
|
|
}
|