1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Config.HolderTest do
6 use ExUnit.Case, async: true
8 alias Pleroma.Config.Holder
10 test "default_config/0" do
11 config = Holder.default_config()
12 assert config[:pleroma][Pleroma.Uploaders.Local][:uploads] == "test/uploads"
13 assert config[:tesla][:adapter] == Tesla.Mock
15 refute config[:pleroma][Pleroma.Repo]
16 refute config[:pleroma][Pleroma.Web.Endpoint]
17 refute config[:pleroma][:env]
18 refute config[:pleroma][:configurable_from_database]
19 refute config[:pleroma][:database]
20 refute config[:phoenix][:serve_endpoints]
23 test "default_config/1" do
24 pleroma_config = Holder.default_config(:pleroma)
25 assert pleroma_config[Pleroma.Uploaders.Local][:uploads] == "test/uploads"
26 tesla_config = Holder.default_config(:tesla)
27 assert tesla_config[:adapter] == Tesla.Mock
30 test "default_config/2" do
31 assert Holder.default_config(:pleroma, Pleroma.Uploaders.Local) == [uploads: "test/uploads"]
32 assert Holder.default_config(:tesla, :adapter) == Tesla.Mock