projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/develop' into simplepolicy-announce-leak
[akkoma]
/
test
/
pleroma
/
web
/
activity_pub
/
pipeline_test.exs
diff --git
a/test/pleroma/web/activity_pub/pipeline_test.exs
b/test/pleroma/web/activity_pub/pipeline_test.exs
index d568d825ba7e7c200cd6b4f1d71a5b458104e7a2..e606fa3d11fbc3353ab797b29203f2e41d50b0aa 100644
(file)
--- a/
test/pleroma/web/activity_pub/pipeline_test.exs
+++ b/
test/pleroma/web/activity_pub/pipeline_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.PipelineTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.PipelineTest do
@@
-25,9
+25,6
@@
defmodule Pleroma.Web.ActivityPub.PipelineTest do
MRFMock
|> expect(:pipeline_filter, fn o, m -> {:ok, o, m} end)
MRFMock
|> expect(:pipeline_filter, fn o, m -> {:ok, o, m} end)
- ActivityPubMock
- |> expect(:persist, fn o, m -> {:ok, o, m} end)
-
SideEffectsMock
|> expect(:handle, fn o, m -> {:ok, o, m} end)
|> expect(:handle_after_transaction, fn m -> m end)
SideEffectsMock
|> expect(:handle, fn o, m -> {:ok, o, m} end)
|> expect(:handle_after_transaction, fn m -> m end)
@@
-42,6
+39,9
@@
defmodule Pleroma.Web.ActivityPub.PipelineTest do
activity_with_object = %{activity | data: Map.put(activity.data, "object", object)}
activity_with_object = %{activity | data: Map.put(activity.data, "object", object)}
+ ActivityPubMock
+ |> expect(:persist, fn _, m -> {:ok, activity, m} end)
+
FederatorMock
|> expect(:publish, fn ^activity_with_object -> :ok end)
FederatorMock
|> expect(:publish, fn ^activity_with_object -> :ok end)
@@
-50,7
+50,7
@@
defmodule Pleroma.Web.ActivityPub.PipelineTest do
assert {:ok, ^activity, ^meta} =
Pleroma.Web.ActivityPub.Pipeline.common_pipeline(
assert {:ok, ^activity, ^meta} =
Pleroma.Web.ActivityPub.Pipeline.common_pipeline(
- activity,
+ activity
.data
,
meta
)
end
meta
)
end
@@
-59,6
+59,9
@@
defmodule Pleroma.Web.ActivityPub.PipelineTest do
activity = insert(:note_activity)
meta = [local: true]
activity = insert(:note_activity)
meta = [local: true]
+ ActivityPubMock
+ |> expect(:persist, fn _, m -> {:ok, activity, m} end)
+
FederatorMock
|> expect(:publish, fn ^activity -> :ok end)
FederatorMock
|> expect(:publish, fn ^activity -> :ok end)
@@
-66,29
+69,35
@@
defmodule Pleroma.Web.ActivityPub.PipelineTest do
|> expect(:get, fn [:instance, :federating] -> true end)
assert {:ok, ^activity, ^meta} =
|> expect(:get, fn [:instance, :federating] -> true end)
assert {:ok, ^activity, ^meta} =
- Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity, meta)
+ Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity
.data
, meta)
end
test "it goes through validation, filtering, persisting, side effects without federation for remote activities" do
activity = insert(:note_activity)
meta = [local: false]
end
test "it goes through validation, filtering, persisting, side effects without federation for remote activities" do
activity = insert(:note_activity)
meta = [local: false]
+ ActivityPubMock
+ |> expect(:persist, fn _, m -> {:ok, activity, m} end)
+
ConfigMock
|> expect(:get, fn [:instance, :federating] -> true end)
assert {:ok, ^activity, ^meta} =
ConfigMock
|> expect(:get, fn [:instance, :federating] -> true end)
assert {:ok, ^activity, ^meta} =
- Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity, meta)
+ Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity
.data
, meta)
end
test "it goes through validation, filtering, persisting, side effects without federation for local activities if federation is deactivated" do
activity = insert(:note_activity)
meta = [local: true]
end
test "it goes through validation, filtering, persisting, side effects without federation for local activities if federation is deactivated" do
activity = insert(:note_activity)
meta = [local: true]
+ ActivityPubMock
+ |> expect(:persist, fn _, m -> {:ok, activity, m} end)
+
ConfigMock
|> expect(:get, fn [:instance, :federating] -> false end)
assert {:ok, ^activity, ^meta} =
ConfigMock
|> expect(:get, fn [:instance, :federating] -> false end)
assert {:ok, ^activity, ^meta} =
- Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity, meta)
+ Pleroma.Web.ActivityPub.Pipeline.common_pipeline(activity
.data
, meta)
end
end
end
end
end
end