diff options
author | tusooa <tusooa@kazv.moe> | 2022-09-04 18:43:36 +0000 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2022-09-04 18:43:36 +0000 |
commit | 20347898e22d10f377cd35f21407555dbac53bbf (patch) | |
tree | 2e8b1afbda166dc3368152e058e5caca2df65241 /test/support | |
parent | c63cf954dea70f76beed007e11902d0a0470fc3a (diff) | |
parent | 88c1c76d3eca3412d1e02008f1b8d96fe8fe0b96 (diff) | |
download | pleroma-20347898e22d10f377cd35f21407555dbac53bbf.tar.gz |
Merge branch 'fix/federation-context-issues' into 'develop'
Fix reply context fixing (Pleroma replies to Misskey threads) and removal of context objects
See merge request pleroma/pleroma!3717
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/http_request_mock.ex | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index eb844e469..7f6065579 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -1084,6 +1084,14 @@ defmodule HttpRequestMock do }} end + def get("https://404.site" <> _, _, _, _) do + {:ok, + %Tesla.Env{ + status: 404, + body: "" + }} + end + def get( "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:lain@zetsubou.xn--q9jyb4c", _, @@ -1401,6 +1409,51 @@ defmodule HttpRequestMock do }} end + def get("https://mk.absturztau.be/users/8ozbzjs3o8", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/mametsuko@mk.absturztau.be.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://p.helene.moe/users/helene", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/helene@p.helene.moe.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://mk.absturztau.be/notes/93e7nm8wqg", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/mk.absturztau.be-93e7nm8wqg.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://mk.absturztau.be/notes/93e7nm8wqg/activity", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/mk.absturztau.be-93e7nm8wqg-activity.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://p.helene.moe/objects/fd5910ac-d9dc-412e-8d1d-914b203296c4", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/p.helene.moe-AM7S6vZQmL6pI9TgPY.json"), + headers: activitypub_object_headers() + }} + end + def get(url, query, body, headers) do {:error, "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"} |