summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2023-11-28 18:54:11 +0000
committerMark Felder <feld@feld.me>2023-12-29 22:50:26 -0500
commite7d6b835ae908be8e9f6a303a77c87860fb7a377 (patch)
tree3da186b46125a68162515ba0a1b5c12713bea3ff /test
parent8ac4458630026387a5394b427daa409b0d2667ba (diff)
Fix tests by leveraging Keyword.equal?/2
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/healthcheck_test.exs6
-rw-r--r--test/pleroma/repo/migrations/autolinker_to_linkify_test.exs6
-rw-r--r--test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs4
3 files changed, 9 insertions, 7 deletions
diff --git a/test/pleroma/healthcheck_test.exs b/test/pleroma/healthcheck_test.exs
index 733537f02..a8ab865ac 100644
--- a/test/pleroma/healthcheck_test.exs
+++ b/test/pleroma/healthcheck_test.exs
@@ -9,14 +9,16 @@ defmodule Pleroma.HealthcheckTest do
test "system_info/0" do
result = Healthcheck.system_info() |> Map.from_struct()
- assert Map.keys(result) == [
+ keys = Map.keys(result)
+
+ assert Keyword.equal?(keys, [
:active,
:healthy,
:idle,
:job_queue_stats,
:memory_used,
:pool_size
- ]
+ ])
end
describe "check_health/1" do
diff --git a/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs b/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs
index 52a606368..9847781f0 100644
--- a/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs
+++ b/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs
@@ -29,13 +29,13 @@ defmodule Pleroma.Repo.Migrations.AutolinkerToLinkifyTest do
%{value: new_opts} = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Formatter})
- assert new_opts == [
+ assert Keyword.equal?(new_opts,
class: false,
extra: true,
new_window: false,
rel: "testing",
strip_prefix: false
- ]
+ )
clear_config(Pleroma.Formatter, new_opts)
assert new_opts == Pleroma.Config.get(Pleroma.Formatter)
@@ -67,6 +67,6 @@ defmodule Pleroma.Repo.Migrations.AutolinkerToLinkifyTest do
strip_prefix: false
]
- assert migration.transform_opts(old_opts) == expected_opts
+ assert Keyword.equal?(migration.transform_opts(old_opts), expected_opts)
end
end
diff --git a/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs b/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs
index 4c45adb4b..cf3fe5aac 100644
--- a/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs
+++ b/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs
@@ -26,13 +26,13 @@ defmodule Pleroma.Repo.Migrations.FixMalformedFormatterConfigTest do
%{value: new_opts} = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Formatter})
- assert new_opts == [
+ assert Keyword.equal?(new_opts,
class: false,
extra: true,
new_window: false,
rel: "F",
strip_prefix: false
- ]
+ )
clear_config(Pleroma.Formatter, new_opts)
assert new_opts == Pleroma.Config.get(Pleroma.Formatter)