From 9f4cc5d9814e163c20ede783412cafd103cd08a0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 18 May 2021 16:04:01 +0200 Subject: [PATCH] Fix ActivityPub test contacting dead server Signed-off-by: Thomas Citharel --- .../activity_pub/activity_pub_test.exs | 4 +-- .../transmogrifier/comments_test.exs | 6 ++-- test/fixtures/mastodon-status-3.json | 23 ++++++++------- test/fixtures/mastodon-status-4.json | 24 +++++++-------- test/fixtures/pleroma-comment-object.json | 29 ++++++++----------- 5 files changed, 41 insertions(+), 45 deletions(-) diff --git a/test/federation/activity_pub/activity_pub_test.exs b/test/federation/activity_pub/activity_pub_test.exs index 776ba7e2..aa72aae8 100644 --- a/test/federation/activity_pub/activity_pub_test.exs +++ b/test/federation/activity_pub/activity_pub_test.exs @@ -61,8 +61,8 @@ defmodule Mobilizon.Federation.ActivityPubTest do end test "object reply by url" do - url = "https://zoltasila.pl/objects/1c295713-8e3c-411e-9e62-57a7b9c9e514" - reply_to_url = "https://framapiaf.org/users/peertube/statuses/104584600044284729" + url = "https://pirateradio.social/notice/A5XnLBsFNQDKtthzM0" + reply_to_url = "https://framapiaf.org/users/peertube/statuses/105945857653893100" data = File.read!("test/fixtures/mastodon-status-3.json") diff --git a/test/federation/activity_pub/transmogrifier/comments_test.exs b/test/federation/activity_pub/transmogrifier/comments_test.exs index 34d9e1e6..8729ca51 100644 --- a/test/federation/activity_pub/transmogrifier/comments_test.exs +++ b/test/federation/activity_pub/transmogrifier/comments_test.exs @@ -40,7 +40,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do File.read!("test/fixtures/mastodon-post-activity.json") |> 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 = data["object"] @@ -65,11 +65,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do %Comment{} = origin_comment = 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"] == - "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 end diff --git a/test/fixtures/mastodon-status-3.json b/test/fixtures/mastodon-status-3.json index a650d063..0f00cddf 100644 --- a/test/fixtures/mastodon-status-3.json +++ b/test/fixtures/mastodon-status-3.json @@ -1,23 +1,24 @@ { "@context": [ "https://www.w3.org/ns/activitystreams", - "https://zoltasila.pl/schemas/litepub-0.1.jsonld", + "https://pirateradio.social/schemas/litepub-0.1.jsonld", { "@language": "und" } ], - "actor": "https://zoltasila.pl/users/mkljczk", + "actor": "https://pirateradio.social/users/captain", "attachment": [], - "attributedTo": "https://zoltasila.pl/users/mkljczk", - "cc": ["https://zoltasila.pl/users/mkljczk/followers"], - "content": "

@peertube guess you wanted to put the en_US lang link

", - "context": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation", - "conversation": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation", - "id": "https://zoltasila.pl/objects/1c295713-8e3c-411e-9e62-57a7b9c9e514", - "inReplyTo": "https://framapiaf.org/users/peertube/statuses/104584600044284729", - "published": "2020-07-27T09:37:57.202806Z", + "attributedTo": "https://pirateradio.social/users/captain", + "cc": ["https://pirateradio.social/users/captain/followers"], + "content": "

@peertube Pirate Radio TV is updated. You can now remote follow channels on PeerTube, awesome!

", + "context": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation", + "conversation": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation", + "id": "https://pirateradio.social/objects/eeaa8ced-27d6-49bb-a53b-fd2646b63f99", + "inReplyTo": "https://framapiaf.org/users/peertube/statuses/105945857653893100", + "published": "2021-03-24T19:01:37.759478Z", + "repliesCount": 1, "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": "", "tag": [ { diff --git a/test/fixtures/mastodon-status-4.json b/test/fixtures/mastodon-status-4.json index 31e70078..ddc8091a 100644 --- a/test/fixtures/mastodon-status-4.json +++ b/test/fixtures/mastodon-status-4.json @@ -16,40 +16,40 @@ } } ], - "id": "https://framapiaf.org/users/peertube/statuses/104584600044284729", + "id": "https://framapiaf.org/users/peertube/statuses/105945857653893100", "type": "Note", "summary": null, "inReplyTo": null, - "published": "2020-07-27T07:19:11Z", - "url": "https://framapiaf.org/@peertube/104584600044284729", + "published": "2021-03-24T17:04:54Z", + "url": "https://framapiaf.org/@peertube/105945857653893100", "attributedTo": "https://framapiaf.org/users/peertube", "to": ["https://www.w3.org/ns/activitystreams#Public"], "cc": ["https://framapiaf.org/users/peertube/followers"], "sensitive": false, - "atomUri": "https://framapiaf.org/users/peertube/statuses/104584600044284729", + "atomUri": "https://framapiaf.org/users/peertube/statuses/105945857653893100", "inReplyToAtomUri": null, - "conversation": "tag:framapiaf.org,2020-07-27:objectId=39135637:objectType=Conversation", - "content": "

PeerTube 2.3 is out! Discover on https://joinpeertube.org/fr_FR/news#release-2-3-0 the list of new features!

Have you seen the broadcast message system ? šŸ¤©

", + "conversation": "tag:framapiaf.org,2021-03-24:objectId=47491096:objectType=Conversation", + "content": "

PeerTube v3.1 is out!
Better transcoding features, more pleasant interfaces, possibility to easily subscribe to a remote account and... so many great features!

āž”ļø https://joinpeertube.org/en_US/news#release-3.1

", "contentMap": { - "en": "

PeerTube 2.3 is out! Discover on https://joinpeertube.org/fr_FR/news#release-2-3-0 the list of new features!

Have you seen the broadcast message system ? šŸ¤©

" + "en": "

PeerTube v3.1 is out!
Better transcoding features, more pleasant interfaces, possibility to easily subscribe to a remote account and... so many great features!

āž”ļø https://joinpeertube.org/en_US/news#release-3.1

" }, "attachment": [ { "type": "Document", "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, - "blurhash": "U5SY?Z00nOxu7ORP.8-pU^kVS#NGXyxbMxM{" + "blurhash": "UdMHJg00D%9F-pozjFoL?aWBe.of%Mofaeof" } ], "tag": [], "replies": { - "id": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies", + "id": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies", "type": "Collection", "first": { "type": "CollectionPage", - "next": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies?only_other_accounts=true&page=true", - "partOf": "https://framapiaf.org/users/peertube/statuses/104584600044284729/replies", + "next": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies?only_other_accounts=true&page=true", + "partOf": "https://framapiaf.org/users/peertube/statuses/105945857653893100/replies", "items": [] } } diff --git a/test/fixtures/pleroma-comment-object.json b/test/fixtures/pleroma-comment-object.json index 843170f5..2a5f4239 100644 --- a/test/fixtures/pleroma-comment-object.json +++ b/test/fixtures/pleroma-comment-object.json @@ -1,28 +1,23 @@ { "@context": [ "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" } ], - "actor": "https://blob.cat/users/comicbot", - "attachment": [ - { - "mediaType": "image/gif", - "name": "1574936800141.gif", - "type": "Document", - "url": "https://blob.cat/media/143ba9b1ed15e67d7401906f7b71a459b90680af7075af5b8ac9cb8e3b86868a.gif" - } - ], - "attributedTo": "https://blob.cat/users/comicbot", - "cc": ["https://blob.cat/users/comicbot/followers"], - "content": "Super Mega Comics
http://supermegacomics.com/", - "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", + "actor": "https://soc.punktrash.club/users/jorin", + "attachment": [], + "attributedTo": "https://soc.punktrash.club/users/jorin", + "cc": ["https://soc.punktrash.club/users/jorin/followers"], + "content": "I live in Spain

The S is silent

And it's French

šŸ„–šŸ˜Ž", + "context": "https://soc.punktrash.club/contexts/62eb8f27-c8ea-4cc3-818d-385ff96e4397", + "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", + "repliesCount": 1, "sensitive": false, + "source": "I live in Spain\n\nThe S is silent\n\nAnd it's French\n\nšŸ„–šŸ˜Ž", "summary": "", "tag": [], "to": ["https://www.w3.org/ns/activitystreams#Public"],