feat: add clean up media files task
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"backend/common/service/testx"
|
||||
"backend/modules/medias"
|
||||
"backend/providers/postgres"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/stretchr/testify/suite"
|
||||
@@ -22,8 +24,11 @@ type DiscoverMediasTestSuite struct {
|
||||
}
|
||||
|
||||
func Test_DiscoverMedias(t *testing.T) {
|
||||
providers := testx.Default().With(
|
||||
providers := testx.Default(
|
||||
postgres.DefaultProvider(),
|
||||
).With(
|
||||
Provide,
|
||||
medias.Provide,
|
||||
)
|
||||
|
||||
testx.Serve(providers, t, func(params DiscoverMediasInjectParams) {
|
||||
@@ -63,3 +68,18 @@ func (t *DiscoverMediasTestSuite) Test_ffmpegVideoToM3U8() {
|
||||
So(err, ShouldBeNil)
|
||||
})
|
||||
}
|
||||
|
||||
func (t *DiscoverMediasTestSuite) Test_item() {
|
||||
Convey("Test_item", t.T(), func() {
|
||||
items := []int{}
|
||||
defer func() {
|
||||
for _, item := range items {
|
||||
t.T().Logf("Recovered in f %d", item)
|
||||
}
|
||||
}()
|
||||
|
||||
for i := 0; i < 4; i++ {
|
||||
items = append(items, i)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user