remove dead proxy service and sora storage action
This commit is contained in:
@@ -25,35 +25,6 @@ func TestSoraHandler_ListGenerations(t *testing.T) {
|
||||
assert.Contains(t, w.Body.String(), "items")
|
||||
}
|
||||
|
||||
func TestSoraHandler_ClearUserStorage_InvalidUserID(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
handler := &SoraHandler{}
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
userID string
|
||||
expected int
|
||||
}{
|
||||
{"empty string", "", http.StatusBadRequest},
|
||||
{"non-numeric", "abc", http.StatusBadRequest},
|
||||
{"float", "1.5", http.StatusBadRequest},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
w := httptest.NewRecorder()
|
||||
c, _ := gin.CreateTestContext(w)
|
||||
c.Request = httptest.NewRequest(http.MethodDelete, "/admin/sora/users/"+tc.userID+"/storage", nil)
|
||||
c.Params = gin.Params{{Key: "id", Value: tc.userID}}
|
||||
|
||||
handler.ClearUserStorage(c)
|
||||
|
||||
assert.Equal(t, tc.expected, w.Code)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSoraSystemStatsResponse_Fields(t *testing.T) {
|
||||
resp := SoraSystemStatsResponse{
|
||||
TotalUsers: 10,
|
||||
|
||||
Reference in New Issue
Block a user