2016-03-09 05:12:26 -09:00
|
|
|
package engine
|
2016-03-04 09:12:56 -09:00
|
|
|
|
|
|
|
|
import (
|
2016-03-09 05:12:26 -09:00
|
|
|
"testing"
|
|
|
|
|
|
2020-01-23 15:44:08 -09:00
|
|
|
. "github.com/deluan/navidrome/tests"
|
2016-03-04 09:12:56 -09:00
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestDownsampling(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
Init(t, false)
|
|
|
|
|
|
|
|
|
|
Convey("Subject: createDownsamplingCommand", t, func() {
|
|
|
|
|
|
|
|
|
|
Convey("It should create a valid command line", func() {
|
|
|
|
|
cmd, args := createDownsamplingCommand("/music library/file.mp3", 128)
|
|
|
|
|
|
|
|
|
|
So(cmd, ShouldEqual, "ffmpeg")
|
|
|
|
|
So(args[0], ShouldEqual, "-i")
|
|
|
|
|
So(args[1], ShouldEqual, "/music library/file.mp3")
|
|
|
|
|
So(args[2], ShouldEqual, "-b:a")
|
|
|
|
|
So(args[3], ShouldEqual, "128k")
|
|
|
|
|
So(args[4], ShouldEqual, "mp3")
|
|
|
|
|
So(args[5], ShouldEqual, "-")
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|