2020-01-21 07:49:22 -07:00
|
|
|
# Pleroma: A lightweight social networking server
|
2020-03-01 22:08:45 -07:00
|
|
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
2020-01-21 07:49:22 -07:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Config.LoaderTest do
|
|
|
|
use ExUnit.Case, async: true
|
|
|
|
|
|
|
|
alias Pleroma.Config.Loader
|
|
|
|
|
2020-03-11 09:16:18 -06:00
|
|
|
test "read/1" do
|
|
|
|
config = Loader.read("test/fixtures/config/temp.secret.exs")
|
2020-01-21 07:49:22 -07:00
|
|
|
assert config[:pleroma][:first_setting][:key] == "value"
|
|
|
|
assert config[:pleroma][:first_setting][:key2] == [Pleroma.Repo]
|
|
|
|
assert config[:quack][:level] == :info
|
|
|
|
end
|
|
|
|
|
|
|
|
test "filter_group/2" do
|
|
|
|
assert Loader.filter_group(:pleroma,
|
|
|
|
pleroma: [
|
|
|
|
{Pleroma.Repo, [a: 1, b: 2]},
|
|
|
|
{Pleroma.Upload, [a: 1, b: 2]},
|
|
|
|
{Pleroma.Web.Endpoint, []},
|
|
|
|
env: :test,
|
|
|
|
configurable_from_database: true,
|
|
|
|
database: []
|
|
|
|
]
|
|
|
|
) == [{Pleroma.Upload, [a: 1, b: 2]}]
|
|
|
|
end
|
|
|
|
end
|