projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into feature/expire-mutes
[akkoma]
/
test
/
config
/
config_db_test.exs
diff --git
a/test/config/config_db_test.exs
b/test/config/config_db_test.exs
index a04575c6f16e7d3ca13010d66c0b7643e99b818f..3895e2cdac32f7e0132a998625c45d22de744b52 100644
(file)
--- a/
test/config/config_db_test.exs
+++ b/
test/config/config_db_test.exs
@@
-43,7
+43,7
@@
defmodule Pleroma.ConfigDBTest do
params = [
%{group: :pleroma, key: key2, value: "another_value"},
params = [
%{group: :pleroma, key: key2, value: "another_value"},
- %{group: :pleroma, key: config.key, value:
"new_value"
}
+ %{group: :pleroma, key: config.key, value:
[a: 1, b: 2, c: "new_value"]
}
]
assert Repo.all(ConfigDB) |> length() == 1
]
assert Repo.all(ConfigDB) |> length() == 1
@@
-55,7
+55,7
@@
defmodule Pleroma.ConfigDBTest do
config1 = ConfigDB.get_by_params(%{group: config.group, key: config.key})
config2 = ConfigDB.get_by_params(%{group: :pleroma, key: key2})
config1 = ConfigDB.get_by_params(%{group: config.group, key: config.key})
config2 = ConfigDB.get_by_params(%{group: :pleroma, key: key2})
- assert config1.value ==
"new_value"
+ assert config1.value ==
[a: 1, b: 2, c: "new_value"]
assert config2.value == "another_value"
end
assert config2.value == "another_value"
end
@@
-382,12
+382,6
@@
defmodule Pleroma.ConfigDBTest do
assert ConfigDB.to_elixir_types([%{"tuple" => [":key", "value"]}]) == [key: "value"]
end
assert ConfigDB.to_elixir_types([%{"tuple" => [":key", "value"]}]) == [key: "value"]
end
- test "keyword with partial_chain key" do
- assert ConfigDB.to_elixir_types([
- %{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]}
- ]) == [partial_chain: &:hackney_connect.partial_chain/1]
- end
-
test "keyword" do
assert ConfigDB.to_elixir_types([
%{"tuple" => [":types", "Pleroma.PostgresTypes"]},
test "keyword" do
assert ConfigDB.to_elixir_types([
%{"tuple" => [":types", "Pleroma.PostgresTypes"]},
@@
-404,6
+398,10
@@
defmodule Pleroma.ConfigDBTest do
]
end
]
end
+ test "trandformed keyword" do
+ assert ConfigDB.to_elixir_types(a: 1, b: 2, c: "string") == [a: 1, b: 2, c: "string"]
+ end
+
test "complex keyword with nested mixed childs" do
assert ConfigDB.to_elixir_types([
%{"tuple" => [":uploader", "Pleroma.Uploaders.Local"]},
test "complex keyword with nested mixed childs" do
assert ConfigDB.to_elixir_types([
%{"tuple" => [":uploader", "Pleroma.Uploaders.Local"]},