update unit tests for new createProfileImage func
Этот коммит содержится в:
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/goamz/goamz/s3"
|
"github.com/goamz/goamz/s3"
|
||||||
"github.com/mattermost/platform/model"
|
"github.com/mattermost/platform/model"
|
||||||
"github.com/mattermost/platform/utils"
|
"github.com/mattermost/platform/utils"
|
||||||
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"io"
|
"io"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
@@ -324,14 +325,20 @@ func TestGetAudits(t *testing.T) {
|
|||||||
func TestUserCreateImage(t *testing.T) {
|
func TestUserCreateImage(t *testing.T) {
|
||||||
Setup()
|
Setup()
|
||||||
|
|
||||||
i := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba")
|
b, err := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba")
|
||||||
if i == nil {
|
if err != nil {
|
||||||
t.Fatal("Failed to gen image")
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rdr := bytes.NewReader(b)
|
||||||
|
img, _, err2 := image.Decode(rdr)
|
||||||
|
if err2 != nil {
|
||||||
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
colorful := color.RGBA{116, 49, 196, 255}
|
colorful := color.RGBA{116, 49, 196, 255}
|
||||||
|
|
||||||
if i.RGBAAt(1, 1) != colorful {
|
if img.At(1, 1) != colorful {
|
||||||
t.Fatal("Failed to create correct color")
|
t.Fatal("Failed to create correct color")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user