forked from AkkomaGang/akkoma
Merge branch 'flaky-tests' into 'develop'
Flaky tests See merge request pleroma/pleroma!2578
This commit is contained in:
commit
6783d544b2
1 changed files with 8 additions and 4 deletions
|
@ -14,13 +14,17 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicyTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
clear_config(:mrf_steal_emoji)
|
|
||||||
|
|
||||||
emoji_path = Path.join(Config.get([:instance, :static_dir]), "emoji/stolen")
|
emoji_path = Path.join(Config.get([:instance, :static_dir]), "emoji/stolen")
|
||||||
File.rm_rf!(emoji_path)
|
File.rm_rf!(emoji_path)
|
||||||
File.mkdir!(emoji_path)
|
File.mkdir!(emoji_path)
|
||||||
|
|
||||||
Pleroma.Emoji.reload()
|
Pleroma.Emoji.reload()
|
||||||
|
|
||||||
|
on_exit(fn ->
|
||||||
|
File.rm_rf!(emoji_path)
|
||||||
|
end)
|
||||||
|
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
test "does nothing by default" do
|
test "does nothing by default" do
|
||||||
|
@ -53,8 +57,8 @@ test "Steals emoji on unknown shortcode from allowed remote host" do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.put([:mrf_steal_emoji, :hosts], ["example.org"])
|
clear_config([:mrf_steal_emoji, :hosts], ["example.org"])
|
||||||
Config.put([:mrf_steal_emoji, :size_limit], 284_468)
|
clear_config([:mrf_steal_emoji, :size_limit], 284_468)
|
||||||
|
|
||||||
assert {:ok, message} == StealEmojiPolicy.filter(message)
|
assert {:ok, message} == StealEmojiPolicy.filter(message)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue