Merge branch 'runtime-config' into 'develop'
Runtime configuration See merge request pleroma/pleroma!430
This commit is contained in:
commit
b451a92d78
18 changed files with 191 additions and 163 deletions
|
|
@ -4,6 +4,7 @@ defmodule Pleroma.ConfigTest do
|
|||
test "get/1 with an atom" do
|
||||
assert Pleroma.Config.get(:instance) == Application.get_env(:pleroma, :instance)
|
||||
assert Pleroma.Config.get(:azertyuiop) == nil
|
||||
assert Pleroma.Config.get(:azertyuiop, true) == true
|
||||
end
|
||||
|
||||
test "get/1 with a list of keys" do
|
||||
|
|
@ -20,6 +21,22 @@ defmodule Pleroma.ConfigTest do
|
|||
)
|
||||
|
||||
assert Pleroma.Config.get([:azerty, :uiop]) == nil
|
||||
assert Pleroma.Config.get([:azerty, :uiop], true) == true
|
||||
end
|
||||
|
||||
test "get!/1" do
|
||||
assert Pleroma.Config.get!(:instance) == Application.get_env(:pleroma, :instance)
|
||||
|
||||
assert Pleroma.Config.get!([:instance, :public]) ==
|
||||
Keyword.get(Application.get_env(:pleroma, :instance), :public)
|
||||
|
||||
assert_raise(Pleroma.Config.Error, fn ->
|
||||
Pleroma.Config.get!(:azertyuiop)
|
||||
end)
|
||||
|
||||
assert_raise(Pleroma.Config.Error, fn ->
|
||||
Pleroma.Config.get!([:azerty, :uiop])
|
||||
end)
|
||||
end
|
||||
|
||||
test "put/2 with a key" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue