diff options
author | rinpatch <rinpatch@sdf.org> | 2020-11-12 12:34:48 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-11-12 12:34:48 +0000 |
commit | 1172844ed18d94d84724dc6f11c6e9f72e0ba6ec (patch) | |
tree | 7d48a259e08856ab6db0eba255f20c0c19410463 /test/upload/filter/mogrify_test.exs | |
parent | a0f5e8b27edbe2224d9c2c3997ad5b8ea484244b (diff) | |
parent | b4c6b262d6dc12362f0014a864e8aed6c727c39c (diff) |
Merge branch 'release/2.2.0' into 'stable'v2.2.0
Release/2.2.0
See merge request pleroma/secteam/pleroma!19
Diffstat (limited to 'test/upload/filter/mogrify_test.exs')
-rw-r--r-- | test/upload/filter/mogrify_test.exs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/test/upload/filter/mogrify_test.exs b/test/upload/filter/mogrify_test.exs deleted file mode 100644 index bf64b96b3..000000000 --- a/test/upload/filter/mogrify_test.exs +++ /dev/null @@ -1,41 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Upload.Filter.MogrifyTest do - use Pleroma.DataCase - import Mock - - alias Pleroma.Upload.Filter - - test "apply mogrify filter" do - clear_config(Filter.Mogrify, args: [{"tint", "40"}]) - - File.cp!( - "test/fixtures/image.jpg", - "test/fixtures/image_tmp.jpg" - ) - - upload = %Pleroma.Upload{ - name: "an… image.jpg", - content_type: "image/jpg", - path: Path.absname("test/fixtures/image_tmp.jpg"), - tempfile: Path.absname("test/fixtures/image_tmp.jpg") - } - - task = - Task.async(fn -> - assert_receive {:apply_filter, {_, "tint", "40"}}, 4_000 - end) - - with_mock Mogrify, - open: fn _f -> %Mogrify.Image{} end, - custom: fn _m, _a -> :ok end, - custom: fn m, a, o -> send(task.pid, {:apply_filter, {m, a, o}}) end, - save: fn _f, _o -> :ok end do - assert Filter.Mogrify.filter(upload) == {:ok, :filtered} - end - - Task.await(task) - end -end |