diff options
author | Ilja <domainepublic@spectraltheorem.be> | 2020-10-02 14:51:39 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-08-06 07:59:52 +0200 |
commit | 27fe7b0274cd9904d91167adade2cf7e56fd482b (patch) | |
tree | 79c69d51dc1d7d00728dda3fbc16f93cce34c1dd /test | |
parent | dd947d9bc8320ec828df97353733bed4d4e2b5b8 (diff) | |
download | pleroma-27fe7b0274cd9904d91167adade2cf7e56fd482b.tar.gz |
Make quarentine work with list of tuples instead of strings
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/activity_pub/mrf_test.exs | 9 | ||||
-rw-r--r-- | test/pleroma/web/activity_pub/publisher_test.exs | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/test/pleroma/web/activity_pub/mrf_test.exs b/test/pleroma/web/activity_pub/mrf_test.exs index 61d308b97..6ab27bc86 100644 --- a/test/pleroma/web/activity_pub/mrf_test.exs +++ b/test/pleroma/web/activity_pub/mrf_test.exs @@ -63,6 +63,15 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do end end + describe "instance_list_from_tuples/1" do + test "returns a list of instances from a list of {instance, reason} tuples" do + list = [{"some.tld", "a reason"}, {"other.tld", "another reason"}] + expected = ["some.tld", "other.tld"] + + assert MRF.instance_list_from_tuples(list) == expected + end + end + describe "describe/0" do test "it works as expected with noop policy" do clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.NoOpPolicy]) diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index d0bb43fb2..b50e22bbe 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -271,7 +271,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do Pleroma.Web.Federator.Publisher, [:passthrough], [] do - Config.put([:instance, :quarantined_instances], ["domain.com"]) + Config.put([:instance, :quarantined_instances], [{"domain.com", "some reason"}]) follower = insert(:user, %{ @@ -308,7 +308,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do Pleroma.Web.Federator.Publisher, [:passthrough], [] do - Config.put([:instance, :quarantined_instances], ["somedomain.com"]) + Config.put([:instance, :quarantined_instances], [{"somedomain.com", "some reason"}]) follower = insert(:user, %{ |