APIv4: GET /users/{user_id}/image (#5526)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
19b753467d
Коммит
71d010b7af
@@ -5,6 +5,8 @@ package app
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"image"
|
||||
"image/color"
|
||||
"encoding/json"
|
||||
"math/rand"
|
||||
"strings"
|
||||
@@ -89,7 +91,27 @@ func TestCreateOAuthUser(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("should have failed - user creation disabled")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateProfileImage(t *testing.T) {
|
||||
utils.LoadConfig("config.json")
|
||||
|
||||
b, err := CreateProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba")
|
||||
if err != nil {
|
||||
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}
|
||||
|
||||
if img.At(1, 1) != colorful {
|
||||
t.Fatal("Failed to create correct color")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateOAuthUserAttrs(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user