1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Upload.Filter.MogrifunTest do
10 alias Pleroma.Upload.Filter
12 test "apply mogrify filter" do
14 "test/fixtures/image.jpg",
15 "test/fixtures/image_tmp.jpg"
19 name: "an… image.jpg",
20 content_type: "image/jpg",
21 path: Path.absname("test/fixtures/image_tmp.jpg"),
22 tempfile: Path.absname("test/fixtures/image_tmp.jpg")
27 assert_receive {:apply_filter, {}}, 4_000
33 open: fn _f -> %Mogrify.Image{} end,
34 custom: fn _m, _a -> send(task.pid, {:apply_filter, {}}) end,
35 custom: fn _m, _a, _o -> send(task.pid, {:apply_filter, {}}) end,
36 save: fn _f, _o -> :ok end
39 assert Filter.Mogrifun.filter(upload) == :ok