Fix ActivityPub test contacting dead server
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
159346d5b5
commit
9f4cc5d981
@ -61,8 +61,8 @@ defmodule Mobilizon.Federation.ActivityPubTest do
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "object reply by url" do
|
test "object reply by url" do
|
||||||
url = "https://zoltasila.pl/objects/1c295713-8e3c-411e-9e62-57a7b9c9e514"
|
url = "https://pirateradio.social/notice/A5XnLBsFNQDKtthzM0"
|
||||||
reply_to_url = "https://framapiaf.org/users/peertube/statuses/104584600044284729"
|
reply_to_url = "https://framapiaf.org/users/peertube/statuses/105945857653893100"
|
||||||
|
|
||||||
data =
|
data =
|
||||||
File.read!("test/fixtures/mastodon-status-3.json")
|
File.read!("test/fixtures/mastodon-status-3.json")
|
||||||
|
@ -40,7 +40,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do
|
|||||||
File.read!("test/fixtures/mastodon-post-activity.json")
|
File.read!("test/fixtures/mastodon-post-activity.json")
|
||||||
|> Jason.decode!()
|
|> Jason.decode!()
|
||||||
|
|
||||||
reply_to_url = "https://blob.cat/objects/02fdea3d-932c-4348-9ecb-3f9eb3fbdd94"
|
reply_to_url = "https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467"
|
||||||
|
|
||||||
object =
|
object =
|
||||||
data["object"]
|
data["object"]
|
||||||
@ -65,11 +65,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do
|
|||||||
%Comment{} =
|
%Comment{} =
|
||||||
origin_comment =
|
origin_comment =
|
||||||
Discussions.get_comment_from_url(
|
Discussions.get_comment_from_url(
|
||||||
"https://blob.cat/objects/02fdea3d-932c-4348-9ecb-3f9eb3fbdd94"
|
"https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467"
|
||||||
)
|
)
|
||||||
|
|
||||||
assert returned_activity.data["object"]["inReplyTo"] ==
|
assert returned_activity.data["object"]["inReplyTo"] ==
|
||||||
"https://blob.cat/objects/02fdea3d-932c-4348-9ecb-3f9eb3fbdd94"
|
"https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467"
|
||||||
|
|
||||||
assert returned_activity.data["object"]["inReplyTo"] == origin_comment.url
|
assert returned_activity.data["object"]["inReplyTo"] == origin_comment.url
|
||||||
end
|
end
|
||||||
|
23
test/fixtures/mastodon-status-3.json
vendored
23
test/fixtures/mastodon-status-3.json
vendored
@ -1,23 +1,24 @@
|
|||||||
{
|
{
|
||||||
"@context": [
|
"@context": [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
"https://zoltasila.pl/schemas/litepub-0.1.jsonld",
|
"https://pirateradio.social/schemas/litepub-0.1.jsonld",
|
||||||
{
|
{
|
||||||
"@language": "und"
|
"@language": "und"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"actor": "https://zoltasila.pl/users/mkljczk",
|
"actor": "https://pirateradio.social/users/captain",
|
||||||
"attachment": [],
|
"attachment": [],
|
||||||
"attributedTo": "https://zoltasila.pl/users/mkljczk",
|
"attributedTo": "https://pirateradio.social/users/captain",
|
||||||
"cc": ["https://zoltasila.pl/users/mkljczk/followers"],
|
"cc": ["https://pirateradio.social/users/captain/followers"],
|
||||||
"content": "<p><span class=\"h-card\"><a class=\"u-url mention\" data-user=\"9xUDK5nC4I2pNtyIsq\" href=\"https://framapiaf.org/@peertube\" rel=\"ugc\">@<span>peertube</span></a></span> guess you wanted to put the <a href=\"https://joinpeertube.org/en_US/news#release-2-3-0\">en_US lang link</a></p>",
|
"content": "<p><span class=\"h-card\"><a class=\"u-url mention\" data-user=\"A56TgeKXmVurb7Znoe\" href=\"https://framapiaf.org/@peertube\" rel=\"ugc\">@<span>peertube</span></a></span> <a href=\"https://tv.pirateradio.social/about/instance\">Pirate Radio TV</a> is updated. You can now remote follow channels on PeerTube, awesome!</p>",
|
||||||
"context": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation",
|
"context": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation",
|
||||||
"conversation": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation",
|
"conversation": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation",
|
||||||
"id": "https://zoltasila.pl/objects/1c295713-8e3c-411e-9e62-57a7b9c9e514",
|
"id": "https://pirateradio.social/objects/eeaa8ced-27d6-49bb-a53b-fd2646b63f99",
|
||||||
"inReplyTo": "https://framapiaf.org/users/peertube/statuses/104584600044284729",
|
"inReplyTo": "https://framapiaf.org/users/peertube/statuses/105945857653893100",
|
||||||
"published": "2020-07-27T09:37:57.202806Z",
|
"published": "2021-03-24T19:01:37.759478Z",
|
||||||
|
"repliesCount": 1,
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"source": "@peertube@framapiaf.org guess you wanted to put the [en_US lang link](https://joinpeertube.org/en_US/news#release-2-3-0)",
|
"source": "@peertube@framapiaf.org [Pirate Radio TV](https://tv.pirateradio.social/about/instance) is updated. You can now remote follow channels on PeerTube, awesome!",
|
||||||
"summary": "",
|
"summary": "",
|
||||||
"tag": [
|
"tag": [
|
||||||
{
|
{
|
||||||
|
24
test/fixtures/mastodon-status-4.json
vendored
24
test/fixtures/mastodon-status-4.json
vendored
@ -16,40 +16,40 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "https://framapiaf.org/users/peertube/statuses/104584600044284729",
|
"id": "https://framapiaf.org/users/peertube/statuses/105945857653893100",
|
||||||
"type": "Note",
|
"type": "Note",
|
||||||
"summary": null,
|
"summary": null,
|
||||||
"inReplyTo": null,
|
"inReplyTo": null,
|
||||||
"published": "2020-07-27T07:19:11Z",
|
"published": "2021-03-24T17:04:54Z",
|
||||||
"url": "https://framapiaf.org/@peertube/104584600044284729",
|
"url": "https://framapiaf.org/@peertube/105945857653893100",
|
||||||
"attributedTo": "https://framapiaf.org/users/peertube",
|
"attributedTo": "https://framapiaf.org/users/peertube",
|
||||||
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
"cc": ["https://framapiaf.org/users/peertube/followers"],
|
"cc": ["https://framapiaf.org/users/peertube/followers"],
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"atomUri": "https://framapiaf.org/users/peertube/statuses/104584600044284729",
|
"atomUri": "https://framapiaf.org/users/peertube/statuses/105945857653893100",
|
||||||
"inReplyToAtomUri": null,
|
"inReplyToAtomUri": null,
|
||||||
"conversation": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation",
|
"conversation": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation",
|
||||||
"content": "<p>PeerTube 2.3 is out! Discover on <a href=\"https://joinpeertube.org/fr_FR/news#release-2-3-0\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">joinpeertube.org/fr_FR/news#re</span><span class=\"invisible\">lease-2-3-0</span></a> the list of new features! </p><p>Have you seen the broadcast message system ? 🤩</p>",
|
"content": "<p>PeerTube v3.1 is out! <br />Better transcoding features, more pleasant interfaces, possibility to easily subscribe to a remote account and... so many great features!</p><p>➡️ <a href=\"https://joinpeertube.org/en_US/news#release-3.1\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">joinpeertube.org/en_US/news#re</span><span class=\"invisible\">lease-3.1</span></a></p>",
|
||||||
"contentMap": {
|
"contentMap": {
|
||||||
"en": "<p>PeerTube 2.3 is out! Discover on <a href=\"https://joinpeertube.org/fr_FR/news#release-2-3-0\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">joinpeertube.org/fr_FR/news#re</span><span class=\"invisible\">lease-2-3-0</span></a> the list of new features! </p><p>Have you seen the broadcast message system ? 🤩</p>"
|
"en": "<p>PeerTube v3.1 is out! <br />Better transcoding features, more pleasant interfaces, possibility to easily subscribe to a remote account and... so many great features!</p><p>➡️ <a href=\"https://joinpeertube.org/en_US/news#release-3.1\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">joinpeertube.org/en_US/news#re</span><span class=\"invisible\">lease-3.1</span></a></p>"
|
||||||
},
|
},
|
||||||
"attachment": [
|
"attachment": [
|
||||||
{
|
{
|
||||||
"type": "Document",
|
"type": "Document",
|
||||||
"mediaType": "image/png",
|
"mediaType": "image/png",
|
||||||
"url": "https://framapiaf.s3.framasoft.org/framapiaf/media_attachments/files/104/584/599/807/860/387/original/88c94143f78fdfa3.png",
|
"url": "https://framapiaf.s3.framasoft.org/framapiaf/media_attachments/files/105/945/857/331/391/923/original/7932c6912fe1e5ac.png",
|
||||||
"name": null,
|
"name": null,
|
||||||
"blurhash": "U5SY?Z00nOxu7ORP.8-pU^kVS#NGXyxbMxM{"
|
"blurhash": "UdMHJg00D%9F-pozjFoL?aWBe.of%Mofaeof"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tag": [],
|
"tag": [],
|
||||||
"replies": {
|
"replies": {
|
||||||
"id": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies",
|
"id": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies",
|
||||||
"type": "Collection",
|
"type": "Collection",
|
||||||
"first": {
|
"first": {
|
||||||
"type": "CollectionPage",
|
"type": "CollectionPage",
|
||||||
"next": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies?only_other_accounts=true&page=true",
|
"next": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies?only_other_accounts=true&page=true",
|
||||||
"partOf": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies",
|
"partOf": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies",
|
||||||
"items": []
|
"items": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
test/fixtures/pleroma-comment-object.json
vendored
29
test/fixtures/pleroma-comment-object.json
vendored
@ -1,28 +1,23 @@
|
|||||||
{
|
{
|
||||||
"@context": [
|
"@context": [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
"https://blob.cat/schemas/litepub-0.1.jsonld",
|
"https://soc.punktrash.club/schemas/litepub-0.1.jsonld",
|
||||||
{
|
{
|
||||||
"@language": "und"
|
"@language": "und"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"actor": "https://blob.cat/users/comicbot",
|
"actor": "https://soc.punktrash.club/users/jorin",
|
||||||
"attachment": [
|
"attachment": [],
|
||||||
{
|
"attributedTo": "https://soc.punktrash.club/users/jorin",
|
||||||
"mediaType": "image/gif",
|
"cc": ["https://soc.punktrash.club/users/jorin/followers"],
|
||||||
"name": "1574936800141.gif",
|
"content": "I live in Spain<br><br>The S is silent<br><br>And it's French<br><br>🥖😎",
|
||||||
"type": "Document",
|
"context": "https://soc.punktrash.club/contexts/62eb8f27-c8ea-4cc3-818d-385ff96e4397",
|
||||||
"url": "https://blob.cat/media/143ba9b1ed15e67d7401906f7b71a459b90680af7075af5b8ac9cb8e3b86868a.gif"
|
"conversation": "https://soc.punktrash.club/contexts/62eb8f27-c8ea-4cc3-818d-385ff96e4397",
|
||||||
}
|
"id": "https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467",
|
||||||
],
|
"published": "2021-05-06T03:52:10.195835Z",
|
||||||
"attributedTo": "https://blob.cat/users/comicbot",
|
"repliesCount": 1,
|
||||||
"cc": ["https://blob.cat/users/comicbot/followers"],
|
|
||||||
"content": "Super Mega Comics <br> <a href=\"http://supermegacomics.com/\" rel=\"ugc\">http://supermegacomics.com/</a>",
|
|
||||||
"context": "https://blob.cat/contexts/26f3271a-3eb8-4f3f-8fb1-8ff96e2c4a47",
|
|
||||||
"conversation": "https://blob.cat/contexts/26f3271a-3eb8-4f3f-8fb1-8ff96e2c4a47",
|
|
||||||
"id": "https://blob.cat/objects/02fdea3d-932c-4348-9ecb-3f9eb3fbdd94",
|
|
||||||
"published": "2019-11-28T10:26:42.503473Z",
|
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
|
"source": "I live in Spain\n\nThe S is silent\n\nAnd it's French\n\n🥖😎",
|
||||||
"summary": "",
|
"summary": "",
|
||||||
"tag": [],
|
"tag": [],
|
||||||
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
|
Loading…
Reference in New Issue
Block a user