mirror of
https://github.com/tgdrive/teldrive.git
synced 2024-11-10 17:14:03 +08:00
30 lines
598 B
Go
30 lines
598 B
Go
package services
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/divyam234/teldrive/internal/database"
|
|
|
|
"github.com/divyam234/teldrive/pkg/models"
|
|
"github.com/stretchr/testify/suite"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type UploadServiceSuite struct {
|
|
suite.Suite
|
|
db *gorm.DB
|
|
srv *UploadService
|
|
}
|
|
|
|
func (s *UploadServiceSuite) SetupSuite() {
|
|
s.db = database.NewTestDatabase(s.T(), false)
|
|
s.srv = NewUploadService(s.db, nil, nil, nil)
|
|
}
|
|
|
|
func (s *UploadServiceSuite) SetupTest() {
|
|
s.srv.db.Where("id is not NULL").Delete(&models.Upload{})
|
|
}
|
|
|
|
func TestUploadSuite(t *testing.T) {
|
|
suite.Run(t, new(UploadServiceSuite))
|
|
}
|