tests: fix AP test failures

This commit is contained in:
William Pitcock 2019-05-12 14:38:40 +00:00
parent d823eb921b
commit 582bd9d170

View file

@ -10,6 +10,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
alias Pleroma.Object alias Pleroma.Object
alias Pleroma.User alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Publisher
alias Pleroma.Web.ActivityPub.Utils alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI
@ -963,8 +964,7 @@ test "it filters broken threads" do
private_activity_1 = Activity.get_by_ap_id_with_object(private_activity_1.data["id"]) private_activity_1 = Activity.get_by_ap_id_with_object(private_activity_1.data["id"])
assert [public_activity, private_activity_1, private_activity_3] == assert [public_activity, private_activity_1, private_activity_3] == activities
activities
assert length(activities) == 3 assert length(activities) == 3
@ -1057,7 +1057,7 @@ test "it can create a Flag activity" do
actor = insert(:user) actor = insert(:user)
inbox = "http://200.site/users/nick1/inbox" inbox = "http://200.site/users/nick1/inbox"
assert {:ok, _} = ActivityPub.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1}) assert {:ok, _} = Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
assert called(Instances.set_reachable(inbox)) assert called(Instances.set_reachable(inbox))
end end
@ -1070,7 +1070,7 @@ test "it can create a Flag activity" do
inbox = "http://200.site/users/nick1/inbox" inbox = "http://200.site/users/nick1/inbox"
assert {:ok, _} = assert {:ok, _} =
ActivityPub.publish_one(%{ Publisher.publish_one(%{
inbox: inbox, inbox: inbox,
json: "{}", json: "{}",
actor: actor, actor: actor,
@ -1089,7 +1089,7 @@ test "it can create a Flag activity" do
inbox = "http://200.site/users/nick1/inbox" inbox = "http://200.site/users/nick1/inbox"
assert {:ok, _} = assert {:ok, _} =
ActivityPub.publish_one(%{ Publisher.publish_one(%{
inbox: inbox, inbox: inbox,
json: "{}", json: "{}",
actor: actor, actor: actor,
@ -1107,8 +1107,7 @@ test "it can create a Flag activity" do
actor = insert(:user) actor = insert(:user)
inbox = "http://404.site/users/nick1/inbox" inbox = "http://404.site/users/nick1/inbox"
assert {:error, _} = assert {:error, _} = Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
ActivityPub.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
assert called(Instances.set_unreachable(inbox)) assert called(Instances.set_unreachable(inbox))
end end
@ -1120,8 +1119,7 @@ test "it can create a Flag activity" do
actor = insert(:user) actor = insert(:user)
inbox = "http://connrefused.site/users/nick1/inbox" inbox = "http://connrefused.site/users/nick1/inbox"
assert {:error, _} = assert {:error, _} = Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
ActivityPub.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
assert called(Instances.set_unreachable(inbox)) assert called(Instances.set_unreachable(inbox))
end end
@ -1133,7 +1131,7 @@ test "it can create a Flag activity" do
actor = insert(:user) actor = insert(:user)
inbox = "http://200.site/users/nick1/inbox" inbox = "http://200.site/users/nick1/inbox"
assert {:ok, _} = ActivityPub.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1}) assert {:ok, _} = Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
refute called(Instances.set_unreachable(inbox)) refute called(Instances.set_unreachable(inbox))
end end
@ -1146,7 +1144,7 @@ test "it can create a Flag activity" do
inbox = "http://connrefused.site/users/nick1/inbox" inbox = "http://connrefused.site/users/nick1/inbox"
assert {:error, _} = assert {:error, _} =
ActivityPub.publish_one(%{ Publisher.publish_one(%{
inbox: inbox, inbox: inbox,
json: "{}", json: "{}",
actor: actor, actor: actor,