diff --git a/lib/pleroma/datetime.ex b/lib/pleroma/date_time.ex similarity index 100% rename from lib/pleroma/datetime.ex rename to lib/pleroma/date_time.ex diff --git a/lib/pleroma/datetime/impl.ex b/lib/pleroma/date_time/impl.ex similarity index 100% rename from lib/pleroma/datetime/impl.ex rename to lib/pleroma/date_time/impl.ex diff --git a/lib/pleroma/mogrify_behaviour.ex b/lib/pleroma/mogrify_behaviour.ex new file mode 100644 index 000000000..234cb86cf --- /dev/null +++ b/lib/pleroma/mogrify_behaviour.ex @@ -0,0 +1,15 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.MogrifyBehaviour do + @moduledoc """ + Behaviour for Mogrify operations. + This module defines the interface for Mogrify operations that can be mocked in tests. + """ + + @callback open(binary()) :: map() + @callback custom(map(), binary()) :: map() + @callback custom(map(), binary(), binary()) :: map() + @callback save(map(), keyword()) :: map() +end diff --git a/lib/pleroma/mogrify.ex b/lib/pleroma/mogrify_wrapper.ex similarity index 64% rename from lib/pleroma/mogrify.ex rename to lib/pleroma/mogrify_wrapper.ex index 77725e8f2..17174fd97 100644 --- a/lib/pleroma/mogrify.ex +++ b/lib/pleroma/mogrify_wrapper.ex @@ -2,18 +2,6 @@ # Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.MogrifyBehaviour do - @moduledoc """ - Behaviour for Mogrify operations. - This module defines the interface for Mogrify operations that can be mocked in tests. - """ - - @callback open(binary()) :: map() - @callback custom(map(), binary()) :: map() - @callback custom(map(), binary(), binary()) :: map() - @callback save(map(), keyword()) :: map() -end - defmodule Pleroma.MogrifyWrapper do @moduledoc """ Default implementation of MogrifyBehaviour that delegates to Mogrify. diff --git a/test/pleroma/upload/filter/anonymize_filename_test.exs b/test/pleroma/upload/filter/anonymize_filename_test.exs index 0f817a5a1..5dae62003 100644 --- a/test/pleroma/upload/filter/anonymize_filename_test.exs +++ b/test/pleroma/upload/filter/anonymize_filename_test.exs @@ -6,8 +6,8 @@ defmodule Pleroma.Upload.Filter.AnonymizeFilenameTest do use Pleroma.DataCase, async: true import Mox - alias Pleroma.Upload alias Pleroma.StaticStubbedConfigMock, as: ConfigMock + alias Pleroma.Upload setup do File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg") diff --git a/test/pleroma/upload/filter/mogrifun_test.exs b/test/pleroma/upload/filter/mogrifun_test.exs index 4de998c88..77a9c1666 100644 --- a/test/pleroma/upload/filter/mogrifun_test.exs +++ b/test/pleroma/upload/filter/mogrifun_test.exs @@ -6,9 +6,9 @@ defmodule Pleroma.Upload.Filter.MogrifunTest do use Pleroma.DataCase, async: true import Mox + alias Pleroma.MogrifyMock alias Pleroma.Upload alias Pleroma.Upload.Filter - alias Pleroma.MogrifyMock test "apply mogrify filter" do File.cp!( diff --git a/test/pleroma/upload/filter/mogrify_test.exs b/test/pleroma/upload/filter/mogrify_test.exs index 6826faafe..f8ed6e8dd 100644 --- a/test/pleroma/upload/filter/mogrify_test.exs +++ b/test/pleroma/upload/filter/mogrify_test.exs @@ -6,9 +6,9 @@ defmodule Pleroma.Upload.Filter.MogrifyTest do use Pleroma.DataCase, async: true import Mox - alias Pleroma.Upload.Filter - alias Pleroma.StaticStubbedConfigMock, as: ConfigMock alias Pleroma.MogrifyMock + alias Pleroma.StaticStubbedConfigMock, as: ConfigMock + alias Pleroma.Upload.Filter setup :verify_on_exit! diff --git a/test/pleroma/upload/filter_test.exs b/test/pleroma/upload/filter_test.exs index 79bc369a6..a369a723a 100644 --- a/test/pleroma/upload/filter_test.exs +++ b/test/pleroma/upload/filter_test.exs @@ -6,8 +6,8 @@ defmodule Pleroma.Upload.FilterTest do use Pleroma.DataCase import Mox - alias Pleroma.Upload.Filter alias Pleroma.StaticStubbedConfigMock, as: ConfigMock + alias Pleroma.Upload.Filter test "applies filters" do ConfigMock diff --git a/test/pleroma/web/plugs/instance_static_test.exs b/test/pleroma/web/plugs/instance_static_test.exs index e8cf17f3f..33b74dcf0 100644 --- a/test/pleroma/web/plugs/instance_static_test.exs +++ b/test/pleroma/web/plugs/instance_static_test.exs @@ -114,7 +114,7 @@ defmodule Pleroma.Web.Plugs.InstanceStaticTest do _ -> nil end) - # It should have been sanitized to application/octet-stream because "application" + # It should have been sanitized to application/octet-stream because "application" # is not in the allowed_mime_types list assert content_type == "application/octet-stream"