fix: sync issues
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"backend/common/media_store"
|
||||
"backend/common/service/testx"
|
||||
"backend/modules/medias"
|
||||
"backend/providers/postgres"
|
||||
@@ -65,17 +66,24 @@ func (t *DiscoverMediasTestSuite) TestDiscoverMedias_getMediaDuration() {
|
||||
Convey("TestDiscoverMedias_getMediaDuration", t.T(), func() {
|
||||
duration, err := t.Svc.getMediaDuration("/projects/mp-qvyun/backend/fixtures/medias/video.mp4")
|
||||
So(err, ShouldBeNil)
|
||||
t.T().Logf("Duration: %0.8f", duration)
|
||||
t.T().Logf("Duration: %d", duration)
|
||||
})
|
||||
}
|
||||
|
||||
func (t *DiscoverMediasTestSuite) Test_globMedias() {
|
||||
Convey("Test_globMedias", t.T(), func() {
|
||||
f, err := t.Svc.globVideos("/mnt/yangpingliang/publish/processed")
|
||||
store, err := media_store.NewStore("/projects/mp-qvyun/backend/fixtures/processed")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
for _, item := range f {
|
||||
t.T().Logf("Item: %s", item)
|
||||
}
|
||||
hash := "eed0fa530f95531f9fac2a962dfbc7ea"
|
||||
store.Update(media_store.VideoInfo{
|
||||
Hash: hash,
|
||||
Name: "video",
|
||||
Duration: 10,
|
||||
})
|
||||
|
||||
info, ok := store.HashExists(hash)
|
||||
So(ok, ShouldBeTrue)
|
||||
So(info.Name, ShouldEqual, "video")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user