Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package mediamdl
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCompressVideo(t *testing.T) {
inputPath := "../testingdata/mediamdl/video/sample.avi"
outputPath := "../testingdata/mediamdl/video/sample-compress-video.mp4"
err := CompressVideo(inputPath, outputPath)
assert.Error(t, err, "This will thrown an error.")
}
func TestResizeVideo(t *testing.T) {
inputPath := "../testingdata/mediamdl/video/sample.mp4"
outputPath := "../testingdata/mediamdl/video/sample-resize-video.mp4"
err := ResizeVideo(inputPath, "100", "100", outputPath)
assert.Error(t, err, "This will thrown an error.")
}
func TestGetAudioFromVideo(t *testing.T) {
inputPath := "../testingdata/mediamdl/audio/sample.mp4"
outputPath := "../testingdata/mediamdl/audio/sample-audio.mp3"
err := GetAudioFromVideo(inputPath, outputPath)
assert.Error(t, err, "This will thrown an error.")
}
func TestCompressImage(t *testing.T) {
inputPath := "../testingdata/mediamdl/image/sample.bmp"
outputPath := "../testingdata/mediamdl/image/sample-compress-image.jpg"
err := CompressImage(inputPath, outputPath)
assert.Error(t, err, "This will thrown an error.")
}
func TestResizeImage(t *testing.T) {
inputPath := "../testingdata/mediamdl/image/sample.bmp"
outputPath := "../testingdata/mediamdl/image/sample-resized-image.bmp"
err := ResizeImage(inputPath, outputPath, "100")
assert.Error(t, err, "This will thrown an error.")
}
func TestResizeImageWithoutAspectRatio(t *testing.T) {
inputPath := "../testingdata/mediamdl/image/sample.bmp"
outputPath := "../testingdata/mediamdl/image/sample-resize-wo-aspect-image.bmp"
err := ResizeImageWithoutAspectRatio(inputPath, outputPath, "100", "100")
assert.Error(t, err, "This will thrown an error.")
}
func TestSmartCropImage(t *testing.T) {
err := SmartCropImage()
assert.Error(t, err, "This will not throw error")