Files
open-im-server/internal/utils/image_test.go
T

29 lines
649 B
Go
Raw Normal View History

2021-10-29 20:51:15 +08:00
package utils
import (
"Open_IM/pkg/utils"
2021-10-29 20:51:15 +08:00
"path/filepath"
"runtime"
"testing"
"github.com/stretchr/testify/assert"
)
var (
_, b, _, _ = runtime.Caller(0)
// Root folder of this project
Root = filepath.Join(filepath.Dir(b), "../..")
)
func Test_GenSmallImage(t *testing.T) {
println(Root)
err := utils.GenSmallImage(Root+"/docs/open-im-logo.png", Root+"/out-test/open-im-logo-test.png")
2021-10-29 20:51:15 +08:00
assert.Nil(t, err)
err = utils.GenSmallImage(Root+"/docs/open-im-logo.png", "out-test/open-im-logo-test.png")
2021-10-29 20:51:15 +08:00
assert.Nil(t, err)
err = utils.GenSmallImage(Root+"/docs/Architecture.jpg", "out-test/Architecture-test.jpg")
2021-10-29 20:51:15 +08:00
assert.Nil(t, err)
}