projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/slow-federation' into 'develop'
[akkoma]
/
test
/
web
/
federator_test.exs
diff --git
a/test/web/federator_test.exs
b/test/web/federator_test.exs
index 147086918e66afce1b218be491016ee0f9001be9..0f43bc8f24e6d93c3857a9b265a66b80fcc365fc 100644
(file)
--- a/
test/web/federator_test.exs
+++ b/
test/web/federator_test.exs
@@
-3,8
+3,9
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.FederatorTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.FederatorTest do
- alias Pleroma.Web.{CommonAPI, Federator}
alias Pleroma.Instances
alias Pleroma.Instances
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.Federator
use Pleroma.DataCase
import Pleroma.Factory
import Mock
use Pleroma.DataCase
import Pleroma.Factory
import Mock
@@
-57,7
+58,7
@@
defmodule Pleroma.Web.FederatorTest do
describe "Targets reachability filtering in `publish`" do
test_with_mock "it federates only to reachable instances via AP",
describe "Targets reachability filtering in `publish`" do
test_with_mock "it federates only to reachable instances via AP",
-
Federato
r,
+
Pleroma.Web.ActivityPub.Publishe
r,
[:passthrough],
[] do
user = insert(:user)
[:passthrough],
[] do
user = insert(:user)
@@
-88,14
+89,17
@@
defmodule Pleroma.Web.FederatorTest do
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
assert called(
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
assert called(
- Federator.enqueue(:publish_single_ap, %{inbox: inbox1, unreachable_since: dt})
+ Pleroma.Web.ActivityPub.Publisher.publish_one(%{
+ inbox: inbox1,
+ unreachable_since: dt
+ })
)
)
- refute called(
Federator.enqueue(:publish_single_ap,
%{inbox: inbox2}))
+ refute called(
Pleroma.Web.ActivityPub.Publisher.publish_one(
%{inbox: inbox2}))
end
test_with_mock "it federates only to reachable instances via Websub",
end
test_with_mock "it federates only to reachable instances via Websub",
-
Federator
,
+
Pleroma.Web.Websub
,
[:passthrough],
[] do
user = insert(:user)
[:passthrough],
[] do
user = insert(:user)
@@
-123,17
+127,17
@@
defmodule Pleroma.Web.FederatorTest do
{:ok, _activity} = CommonAPI.post(user, %{"status" => "HI"})
assert called(
{:ok, _activity} = CommonAPI.post(user, %{"status" => "HI"})
assert called(
-
Federator.enqueue(:publish_single_websub,
%{
+
Pleroma.Web.Websub.publish_one(
%{
callback: sub2.callback,
unreachable_since: dt
})
)
callback: sub2.callback,
unreachable_since: dt
})
)
- refute called(
Federator.enqueue(:publish_single_websub,
%{callback: sub1.callback}))
+ refute called(
Pleroma.Web.Websub.publish_one(
%{callback: sub1.callback}))
end
test_with_mock "it federates only to reachable instances via Salmon",
end
test_with_mock "it federates only to reachable instances via Salmon",
-
Federator
,
+
Pleroma.Web.Salmon
,
[:passthrough],
[] do
user = insert(:user)
[:passthrough],
[] do
user = insert(:user)
@@
-163,13
+167,13
@@
defmodule Pleroma.Web.FederatorTest do
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
assert called(
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
assert called(
-
Federator.enqueue(:publish_single_salmon,
%{
+
Pleroma.Web.Salmon.publish_one(
%{
recipient: remote_user2,
unreachable_since: dt
})
)
recipient: remote_user2,
unreachable_since: dt
})
)
- refute called(
Federator.enqueue(:publish_single_websub,
%{recipient: remote_user1}))
+ refute called(
Pleroma.Web.Salmon.publish_one(
%{recipient: remote_user1}))
end
end
end
end