APIv4: GET /users/{user_id}/image (#5526)

Этот коммит содержится в:
Saturnino Abril
2017-02-27 23:25:28 +09:00
коммит произвёл Joram Wilander
родитель 19b753467d
Коммит 71d010b7af
4 изменённых файлов: 108 добавлений и 1 удалений

Просмотреть файл

@@ -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) {