aboutsummaryrefslogtreecommitdiffstats
path: root/modules/avatar/avatar_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-10-14 21:07:51 +0800
committerGitHub <noreply@github.com>2020-10-14 21:07:51 +0800
commit80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc (patch)
tree504c7ccdc9cb42e0e282abdd8dbb75c4b24e9f5b /modules/avatar/avatar_test.go
parent93f7525061bc9e6f5be734aba0de31b64c63d7a8 (diff)
downloadgitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.tar.gz
gitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.zip
Avatars and Repo avatars support storing in minio (#12516)
* Avatar support minio * Support repo avatar minio storage * Add missing migration * Fix bug * Fix test * Add test for minio store type on avatars and repo avatars; Add documents * Fix bug * Fix bug * Add back missed avatar link method * refactor codes * Simplify the codes * Code improvements * Fix lint * Fix test mysql * Fix test mysql * Fix test mysql * Fix settings * Fix test * fix test * Fix bug
Diffstat (limited to 'modules/avatar/avatar_test.go')
-rw-r--r--modules/avatar/avatar_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/avatar/avatar_test.go b/modules/avatar/avatar_test.go
index 662d50fadd..8535605652 100644
--- a/modules/avatar/avatar_test.go
+++ b/modules/avatar/avatar_test.go
@@ -22,8 +22,8 @@ func Test_RandomImage(t *testing.T) {
}
func Test_PrepareWithPNG(t *testing.T) {
- setting.AvatarMaxWidth = 4096
- setting.AvatarMaxHeight = 4096
+ setting.Avatar.MaxWidth = 4096
+ setting.Avatar.MaxHeight = 4096
data, err := ioutil.ReadFile("testdata/avatar.png")
assert.NoError(t, err)
@@ -36,8 +36,8 @@ func Test_PrepareWithPNG(t *testing.T) {
}
func Test_PrepareWithJPEG(t *testing.T) {
- setting.AvatarMaxWidth = 4096
- setting.AvatarMaxHeight = 4096
+ setting.Avatar.MaxWidth = 4096
+ setting.Avatar.MaxHeight = 4096
data, err := ioutil.ReadFile("testdata/avatar.jpeg")
assert.NoError(t, err)
@@ -50,15 +50,15 @@ func Test_PrepareWithJPEG(t *testing.T) {
}
func Test_PrepareWithInvalidImage(t *testing.T) {
- setting.AvatarMaxWidth = 5
- setting.AvatarMaxHeight = 5
+ setting.Avatar.MaxWidth = 5
+ setting.Avatar.MaxHeight = 5
_, err := Prepare([]byte{})
assert.EqualError(t, err, "DecodeConfig: image: unknown format")
}
func Test_PrepareWithInvalidImageSize(t *testing.T) {
- setting.AvatarMaxWidth = 5
- setting.AvatarMaxHeight = 5
+ setting.Avatar.MaxWidth = 5
+ setting.Avatar.MaxHeight = 5
data, err := ioutil.ReadFile("testdata/avatar.png")
assert.NoError(t, err)