1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 Code.put_compiler_option(:warnings_as_errors, true)
7 ExUnit.configure(max_cases: System.schedulers_online())
9 ExUnit.start(exclude: [:federated, :erratic])
11 if match?({:unix, :darwin}, :os.type()) do
12 excluded = ExUnit.configuration() |> Keyword.get(:exclude, [])
13 excluded = excluded ++ [:skip_darwin]
14 ExUnit.configure(exclude: excluded)
17 Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, :manual)
19 Mox.defmock(Pleroma.ReverseProxy.ClientMock, for: Pleroma.ReverseProxy.Client)
20 Mox.defmock(Pleroma.GunMock, for: Pleroma.Gun)
22 {:ok, _} = Application.ensure_all_started(:ex_machina)
24 ExUnit.after_suite(fn _results ->
25 uploads = Pleroma.Config.get([Pleroma.Uploaders.Local, :uploads], "test/uploads")
29 defmodule Pleroma.Test.StaticConfig do
31 This module provides a Config that is completely static, built at startup time from the environment. It's safe to use in testing as it will not modify any state.
34 @behaviour Pleroma.Config.Getting
35 @config Application.get_all_env(:pleroma)
37 def get(path, default \\ nil) do
38 get_in(@config, path) || default